Run a spring boot database test against a database running in a docker container that's managed by the test lifecycle.
Spring Boot supports testing with an embedded database out-of-the-box. It's fast because it's in-memory, and the default h2 vendor supports most sql use cases. However, for use cases that an embedded h2 database doesn't support, running tests against a db2 database vendor will provide the advantage of testing specific features before executing an end-to-end test.
- db2
- testcontainers
- spring boot data jpa