// tools/generate-tests/generators/microservices/test-defs.ts — SPEC-058b Section E
// Generates TestDefinition array for microservices test scenarios.
import { detectBroker, detectServiceMesh } from './detectors.js';
export function generateMicroservicesTestDefs(title, testDir, _testExt, knowledge) {
    const defs = [
        {
            name: `${title} — contract testing: inter-service Pact verification`,
            type: 'integration',
            file: `${testDir}/microservices/`,
            description: 'Consumer-driven contract tests verify API compatibility between services',
            priority: 'critical',
            automatable: true,
        },
        {
            name: `${title} — circuit breaker: open/half-open/closed state transitions`,
            type: 'integration',
            file: `${testDir}/microservices/`,
            description: 'Verify circuit breaker opens on failures, transitions to half-open, and closes on recovery',
            priority: 'high',
            automatable: true,
        },
        {
            name: `${title} — retry with backoff: exponential backoff and idempotency`,
            type: 'integration',
            file: `${testDir}/microservices/`,
            description: 'Verify retry logic uses exponential backoff with jitter and respects idempotency keys',
            priority: 'high',
            automatable: true,
        },
        {
            name: `${title} — health checks: liveness and readiness probes`,
            type: 'integration',
            file: `${testDir}/microservices/`,
            description: 'Verify /healthz, /readyz, and startup probes return correct status codes',
            priority: 'critical',
            automatable: true,
        },
    ];
    if (detectBroker(knowledge) !== null) {
        defs.push({
            name: `${title} — message broker: delivery guarantee and DLQ handling`,
            type: 'integration',
            file: `${testDir}/microservices/`,
            description: 'Verify message delivery, ordering, dead letter queue handling, and consumer group rebalancing',
            priority: 'high',
            automatable: true,
        });
    }
    if (detectServiceMesh(knowledge) !== null) {
        defs.push({
            name: `${title} — service mesh: routing rules and mTLS verification`,
            type: 'integration',
            file: `${testDir}/microservices/`,
            description: 'Verify routing rules, mTLS certificate verification, and traffic splitting configuration',
            priority: 'medium',
            automatable: true,
        });
    }
    return defs;
}
//# sourceMappingURL=test-defs.js.map