Scala Example: TestContainers and MUnit
Scala Example: TestContainers and MUnit
Created:
Abstract
Simple example of an Integration test using:
- testcontainers-scala
docker-composewith 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
itscope to the librariesAdd
IntegrationTestconfiguration extendingTestconfigurationAdd
Default.itSettingsto 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.