/** * Shared Test Utilities for SAP LLM Gateway Services * * Common test utilities, factories, and helpers used across * gateway and admin service test suites. */ export interface TestEnvironment { originalEnv: { [key: string]: string | undefined; }; testStartTime: number; } /** * Set up test environment with common configuration */ export declare function setupTestEnvironment(): TestEnvironment; /** * Restore environment after test */ export declare function teardownTestEnvironment(testEnv: TestEnvironment): void; /** * Common test data factory for API keys */ export declare class TestDataFactory { static createApiKeyRequest(overrides?: Partial): { apiKey: string; clientIp: string; userAgent: string; method: string; endpoint: string; headers: { 'content-type': string; 'user-agent': string; }; }; static createAwsCredentialRequest(overrides?: Partial): { accessKeyId: string; region: string; service: string; clientIp: string; userAgent: string; }; static createValidationResponse(valid?: boolean, overrides?: Partial): { valid: boolean; authType: string; data: { keyId: string; name: string; email: string; isActive: boolean; permissions: string[]; }; metadata: { userId: string; lastValidated: string; }; cached: boolean; }; static createCacheEntry(overrides?: Partial): { data: { valid: boolean; authType: string; data: { keyId: string; name: string; email: string; isActive: boolean; permissions: string[]; }; metadata: { userId: string; lastValidated: string; }; cached: boolean; }; expiresAt: number; createdAt: number; }; } /** * Test assertion helpers */ export declare class TestAssertions { /** * Assert that an object has required properties */ static hasRequiredProperties(obj: any, properties: string[]): void; /** * Assert that a value is a valid UUID */ static isValidUuid(value: string): boolean; /** * Assert that a value is a valid API key format */ static isValidApiKeyFormat(value: string): boolean; /** * Assert that a value is a valid AWS access key format */ static isValidAwsAccessKeyFormat(value: string): boolean; /** * Assert that execution time is within expected bounds */ static isWithinTimebound(startTime: number, maxMs: number): boolean; } /** * Mock helpers for testing */ export declare class TestMocks { /** * Create a mock HTTP client response */ static createMockHttpResponse(data: any, status?: number): { data: any; status: number; statusText: string; headers: { 'content-type': string; }; }; /** * Create a mock cache adapter */ static createMockCacheAdapter(): { get: any; set: any; delete: any; clear: any; }; } /** * Performance testing helpers */ export declare class PerformanceTestHelpers { /** * Measure execution time of an async function */ static measureExecutionTime(fn: () => Promise): Promise<{ result: T; duration: number; }>; /** * Run concurrent operations and measure performance */ static runConcurrently(operations: (() => Promise)[], maxConcurrency?: number): Promise; } /** * Common test timeouts and configuration */ export declare const TestConfig: { TIMEOUTS: { UNIT_TEST: number; INTEGRATION_TEST: number; E2E_TEST: number; PERFORMANCE_TEST: number; }; PERFORMANCE_THRESHOLDS: { CACHE_OPERATION_MAX_MS: number; API_CALL_MAX_MS: number; VALIDATION_MAX_MS: number; }; RETRY_CONFIG: { MAX_RETRIES: number; RETRY_DELAY_MS: number; }; };