File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 16
16
package org .springframework .data .mongodb .test .util ;
17
17
18
18
import org .springframework .core .env .StandardEnvironment ;
19
+
20
+ import org .testcontainers .containers .wait .strategy .Wait ;
21
+ import org .testcontainers .containers .wait .strategy .WaitAllStrategy ;
19
22
import org .testcontainers .mongodb .MongoDBAtlasLocalContainer ;
20
23
import org .testcontainers .utility .DockerImageName ;
21
24
@@ -36,12 +39,18 @@ public class AtlasContainer extends MongoDBAtlasLocalContainer {
36
39
public static final String ATLAS_HOST = "docker.mongodb.atlas.host" ;
37
40
public static final String ATLAS_PORT = "docker.mongodb.atlas.port" ;
38
41
42
+ public static final WaitAllStrategy WAIT_STRATEGY = new WaitAllStrategy (
43
+ WaitAllStrategy .Mode .WITH_MAXIMUM_OUTER_TIMEOUT ).withStrategy (Wait .forListeningPort ())
44
+ .withStrategy (Wait .forSuccessfulCommand ("runner healthcheck" ));
45
+
39
46
private AtlasContainer (String dockerImageName ) {
40
47
super (DockerImageName .parse (dockerImageName ));
48
+ this .waitingFor (WAIT_STRATEGY );
41
49
}
42
50
43
51
private AtlasContainer (DockerImageName dockerImageName ) {
44
52
super (dockerImageName );
53
+ this .waitingFor (WAIT_STRATEGY );
45
54
}
46
55
47
56
public static AtlasContainer bestMatch () {
You can’t perform that action at this time.
0 commit comments