Scala Example: TestContainers and MUnit
Scala Example: TestContainers and MUnit
Created:
Abstract
Simple example of an Integration test using:
- testcontainers-scala
docker-compose
with database and flyway- MUnit testing framework
Beware the fact that with MUnit the names of the traits might change compared to Scalatest.
Content
Dependencies
- Add dependencies to the project and submodules
- Add the
it
scope to the libraries - Add
IntegrationTest
configuration extendingTest
configuration - Add
Default.itSettings
to your project and submodules settings
Case 1: Single Test Container
Most simple case, where you declare a single container in your test
to use. In the following example a PostgreSQLContainer
is shown.