The ready-made wait strategies.
GenericContainer('redis:7.4-alpine')
.withExposedPorts([6379])
.waitingFor(Wait.forLogMessage(r'Ready to accept connections', 1));
Testcontainers (Java): Wait (Wait.forListeningPort(),
Wait.forLogMessage(regex, times), Wait.forHttp(path),
Wait.forHealthcheck()).
Properties
- 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
Static Methods
-
forAll(
List< WaitStrategy> strategies) → WaitStrategy -
Ready when all of
strategiesare, one after the other. -
forHealthcheck(
) → WaitStrategy -
Ready when the image's
HEALTHCHECKreportshealthy. An image without one fails the start, and so does anunhealthyanswer. -
forHttp(
String path) → HttpWaitStrategy -
Ready when an HTTP request to
pathanswers with an expected status (200 unless HttpWaitStrategy.forStatusCode says otherwise), on the first published port unless HttpWaitStrategy.forPort says otherwise. -
forListeningPort(
) → WaitStrategy - Ready when every published port accepts a connection (the default of a container; with no published port, when the container runs).
-
forLogMessage(
Pattern regex, [int times = 1]) → WaitStrategy -
Ready when
regexhas matchedtimeslines of the container's output (standard output and error). AStringis a regular expression, matched anywhere in the line.