Strategies for Generating Dynamic, Realistic Mocks for Messaging APIs
summary
Shows how to turn AsyncAPI contracts into stateful, time-aware mocks that emit Kafka messages from a Docker Compose test stack, generate dynamic IDs and correlated fields with Micros mock templates, and enforce ordering, delays, retries and duplicate delivery using dispatcher rules. Demonstrates importing multiple spec files, replaying real traffic traces, running integration tests against the mock, and editing example sets so docs and contract tests can use separate human-readable and randomized examples.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:35Event-driven APIs need mocking
- 4:25Mocking challenges
- 6:48AsyncAPI for contracts
- 9:17Realism in dynamic mocks
- 10:41Context-aware mocks with templates
- 11:45Micro: API mocking tool
- 12:06Demo: Dynamic mocks with Micro
- 17:26Key takeaways
- 18:29Q&A
related talks
33mKafka and JMS Mocking with AsyncAPI using Specmatic
50mContinuous API Mocking and Testing with Microcks, Keptn, and Testkube
30mElevating Event-Driven Architecture: Boost your delivery with AsyncAPI and Microcks
24mUsing API spec as an Executable Contract To Mock and Test Microservices
33mMock Me If You Can: Using Mocks in Container Applications for Integration Testing
25mDevelop in parallel and ship earlier with OpenAPI and mocking
33mGraphQL mocking and why it is important for developer productivity.
30mBreak the API Test Data Bottleneck: Real Scenarios on Real Systems
