ForEachContainerFixture

Companion:
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[T <: Startable & Stoppable](container: T): ForEachContainerFixture[T]

Creates a fixture that starts a single container before each test and stops it after each test.

Creates a fixture that starts a single container before each test and stops it after each test.

Example:
class MysqlSpec extends FunSuite with TestContainersFixtures {
 val mysql = ForEachContainerFixture(MySQLContainer())
 // You need to override `munitFixtures` and pass in your container fixture
 override def munitFixtures = List(mysql)
 test("test case name") {
   // Inside your test body you can do with your container whatever you want to
   assert(mysql().jdbcUrl.nonEmpty)
 }
}