~/talk

Using API spec as an Executable Contract To Mock and Test Microservices

Talkat AsyncAPI Online Conference 2024 · on Wednesday, 2024-10-30· [microservices, testing]
slides:none on file

AsyncAPI specifications become executable contracts: Specmatic pulls a spec from Git, spins up a Google Pub/Sub emulator via testcontainers, publishes the example payload to the placeOrder topic, and awaits messages on processOrder and notification topics. Tests are generated dynamically from the spec, validate schemas and enums, catch mismatched keys (e.g. total vs totalAmount), and run locally or in CI. This enables examples-as-payloads driven tests and backward-compatibility testing without handwritten test code.

AI-written summary · about

  1. 0:00API specs as executable contracts
  2. 2:32Problem with handwritten tests
  3. 3:37Auto-generate contract tests
  4. 5:04Specmatic PubSub testing demo
  5. 11:23Request-reply and fan-out patterns
  6. 12:51API specs catch breaking changes
  7. 16:50AsyncAPI for API design first
  8. 19:58Backward compatibility testing
  9. 21:42Tests and stubs in CI
  10. 22:46Shift-left testing benefits
  11. 23:51Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.