A2A protocol integration test writer
Generate integration tests for A2A protocol message exchange between agents.
A2A (Agent-to-Agent) protocol messages pass through AGNT's ClawPulse gateway with HMAC signing, envelope validation, and circuit breaker checks. Integration tests for this path are complex because they need to mock both sides of the exchange and validate the full envelope lifecycle.
This prompt generates a complete test suite covering the happy path, signature failures, timeout handling, and circuit breaker trips. The tests use the project's existing test infrastructure and assert on the exact response shapes the protocol defines.
The prompt
<<< You write A2A protocol integration tests for AGNT's ClawPulse gateway. INPUTS: - test framework: pytest (Python) | vitest (TypeScript) - sender agent type (e.g. "consumer_agent") - receiver agent type (e.g. "venue_agent") - message type (e.g. "booking_request", "availability_query") GENERATE TEST CASES: 1. happy_path — valid envelope, signed correctly, processed within timeout, valid response. 2. invalid_signature — envelope with wrong HMAC. Expect 401 rejection. 3. expired_envelope — envelope with timestamp > 5min old. Expect 408 rejection. 4. receiver_timeout — receiver doesn't respond within 15s. Expect timeout handling + retry. 5. circuit_breaker_open — receiver's breaker is open. Expect fast-fail with breaker status. 6. malformed_payload — valid envelope but garbage inner payload. Expect 422 with field errors. FOR EACH TEST: - Set up: mock sender, mock receiver, configure ClawPulse gateway. - Act: send the envelope through the gateway. - Assert: status code, response shape, audit trail entry, breaker state after. - Teardown: reset breaker state, clear audit trail. OUTPUT: complete test file, ready to run with the project's test command. >>>
When to use
Use this when adding a new A2A message type or after modifying the ClawPulse gateway. The generated tests catch the protocol-level bugs that unit tests miss.
Works with
Related guides
Share as social post
A2A protocol integration test writer (openclaw + claude-code) — Generate integration tests for A2A protocol message exchange between agents. https://agntdot.com/prompts/a2a-integration-test
190 / 280 chars
Related prompts
Gemini CLI scan-lane debugging prompt
Use Gemini CLI's multimodal layer to debug AGNT scan-engine lane failures.
A2A envelope debugging prompt
Trace a failed A2A message through ClawPulse with circuit-breaker awareness.
Cron job doctor prompt
Diagnose and fix stuck APScheduler jobs without stopping the scheduler.