Integration testing your legacy java microservice with docker-maven-plugin
summary
Demonstrates using the docker-maven-plugin to start dependent containers from pom.xml in Maven’s pre-integration phase (and stop them in post-integration), binding exposed ports to random high ports to avoid collisions. Builds a test WAR, runs a Tomcat container mounting test WAR, and spins up MySQL, MinIO (preloaded buckets), Zookeeper and a mock service; runs seven integration tests via Maven Failsafe (≈1 minute), but loses code coverage measurement.
AI-written summary · about
chapters (10)
- 0:00Start
- 0:26My challenge
- 1:39Create Unit Tests?
- 1:53What about integration tests?
- 2:56Microservice Dependencies as Containers
- 3:35Run Integration Tests as an executable?
- 4:18Run Integration Tests within tomcat?
- 5:04Using docker-maven-plugin
- 8:51See it in action!
- 13:52Did I achieve what I wanted?
related talks
48mContainers for Real Integration Tests
39mEasy Java Integrations Testing with Testcontainers
35mReal Integration Tests with TestContainers
30mIntegration tests & testContainers
01h 20mIntegration Testing from the Trenches
26mRemoving Complexity from Integration Tests Using Testcontainers
51mTestContainers: Integration Testing Without the Hassle
15mTestcontainers: Simplify Your Integration Tests and Development
