Testcontainers class final

Marks a test class that uses containers; optional, as in Spring.

A class with @Container() fields starts them whether or not it has this annotation. It only sets what happens without Docker: by default the whole class is skipped, with the reason; with disabledWithoutDocker: false it fails instead, as it does anywhere when the environment variable CONTAINERS_REQUIRED=true is set (set it in CI, so a missing Docker never goes unnoticed).

@SpringBootTest()
@Testcontainers(disabledWithoutDocker: false) // fails without Docker
class BookRepositoryTest { ... }

Spring (Java): @Testcontainers, whose disabledWithoutDocker is false by default (here the default is to skip, as in a project without Docker most tests still run).

Constructors

Testcontainers({bool disabledWithoutDocker = true})
Marks the class; disabledWithoutDocker is true by default.
const

Properties

disabledWithoutDocker → bool
Whether the class is skipped (true) or fails (false) when Docker is not available. CONTAINERS_REQUIRED=true makes it fail either way.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited