This repo is a companion to the blog post.
It contains working Java code samples for four patterns of mocking an API:
- Mocking the API client
- Mocking HTTP calls within a unit test
- Using a mocked API class to move HTTP mocks out of the unit test
- Using a mocked API in conjunction with validation against the OpenAPI spec
See src/test/java for the examples.