/**
 * 服务器端测试工具
 *
 * 为 Hono 服务器和 API 测试提供工具函数
 */

/**
 * 集成测试数据库工具
 */
export {
  setupIntegrationDatabaseHooks
} from './integration-test-db.js';

/**
 * 集成测试工具函数
 */
export {
  IntegrationTestAssertions
} from './integration-test-utils.js';

/**
 * 认证测试工具
 */
export {
  createMockAuthContext,
  createMockJwtPayload,
  createMockAuthMiddleware,
  createMockPermissionMiddleware
} from './test-auth.js';

/**
 * 数据库测试工具
 */
export {
  createMockDataSource,
  createMockEntityManager,
  createMockRepository,
  createMockQueryBuilder,
  setupDatabaseHooks
} from './test-db.js';

/**
 * 服务模拟工具
 */
export {
  createHttpServiceMock,
  createAuthServiceMock,
  createEmailServiceMock,
  createStorageServiceMock,
  createPaymentServiceMock,
  createSmsServiceMock,
  createThirdPartyApiMock,
  mockNetworkDelay,
  mockHttpError,
  mockTimeoutError
} from './service-mocks.js';

/**
 * 服务存根工具
 */
export {
  createMockUserService,
  createMockAuthService,
  createMockRoleService,
  createMockCrudService,
  createMockEmailService,
  createMockFileService,
  serviceStubs,
  setupServiceMocks
} from './service-stubs.js';

/**
 * 服务器测试配置
 */
export interface ServerTestConfig {
  /** API 基础路径 */
  baseUrl: string;
  /** 认证令牌 */
  authToken?: string;
  /** 请求超时时间（毫秒） */
  timeout?: number;
}

/**
 * 默认服务器测试配置
 */
export const defaultServerTestConfig: ServerTestConfig = {
  baseUrl: 'http://localhost:8080',
  timeout: 5000
};