Mocking your microservices with mock server
summary
Demonstrates that MockServer can mock any HTTP dependency and run as a separate process so you can run Docker-built services under test with isolated component tests; uses JUnit 5, Testcontainers, Docker, RestAssured and JSONAssert; builds an over‑engineered Mastermind game service and runs three MockServer containers to replace generator/checker/tournament, verifies requests and JSON bodies and reports tests completing in about 8 seconds; claim is that this reduces cross‑team dependency and it works as shown.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 0:40Microservices
- 3:22What is mock server
- 4:37Client API
- 5:20Why use mock server
- 7:40Where to position mock server
- 9:13Running mock server
- 10:40Mock server vs Kubernetes
- 12:50Overengineered Mastermind
- 14:02Test setup
- 14:31Test containers
- 15:01Create service
- 16:05Initialize clients
- 16:57Mock server
- 18:01Verification
- 19:17Inspection
- 20:50JSON assert
- 21:05Demo code
- 23:00Component test
- 24:56Running the test
- 26:20Wrapping up
related talks
47mMicroservices Testing with Java
33mMock Me If You Can: Using Mocks in Container Applications for Integration Testing
42mUse Docker to test microservices
25mMock to start
01h 03mMocks vs Testcontainers
47mAnother Way to Test Your Microservices
42mMicroservice Testing Techniques
40mStrategic Business Functionality Testing: Accelerating Development Through Mocking
