ForAllContainerFixture

class ForAllContainerFixture[T <: Startable & Stoppable](val container: T) extends Fixture[T]

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

Example:
class MysqlSpec extends FunSuite with TestContainersFixtures {
 val mysql = ForAllContainerFixture(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)
 }
}
Companion:
object
class Fixture[T]
class AnyFixture[T]
class Object
trait Matchable
class Any

Value members

Concrete methods

override def afterAll(): Unit
Definition Classes
Fixture -> AnyFixture
def afterContainerStart(container: T): Unit
override def afterEach(context: AfterEach): Unit
Definition Classes
Fixture -> AnyFixture
def apply(): T
override def beforeAll(): Unit
Definition Classes
Fixture -> AnyFixture
def beforeContainerStop(container: T): Unit
override def beforeEach(context: BeforeEach): Unit
Definition Classes
Fixture -> AnyFixture

Concrete fields

val container: T

Inherited fields

val fixtureName: String
Inherited from:
AnyFixture