|
9 | 9 | import org.apache.commons.io.IOUtils;
|
10 | 10 | import org.slf4j.Logger;
|
11 | 11 | import org.slf4j.LoggerFactory;
|
12 |
| -import org.testcontainers.containers.wait.strategy.HttpWaitStrategy; |
13 |
| -import org.testcontainers.containers.wait.strategy.Wait; |
14 |
| -import org.testcontainers.containers.wait.strategy.WaitAllStrategy; |
15 |
| -import org.testcontainers.containers.wait.strategy.WaitStrategy; |
| 12 | +import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy; |
16 | 13 | import org.testcontainers.utility.DockerImageName;
|
17 | 14 |
|
18 | 15 | import java.io.IOException;
|
19 | 16 | import java.net.URL;
|
20 | 17 | import java.nio.charset.StandardCharsets;
|
21 |
| -import java.time.Duration; |
22 | 18 | import java.util.Optional;
|
23 | 19 |
|
24 |
| -import static java.net.HttpURLConnection.HTTP_OK; |
25 |
| - |
26 | 20 | /**
|
27 | 21 | * @author robfrank
|
28 | 22 | */
|
@@ -68,14 +62,7 @@ public OrientDBContainer(final DockerImageName dockerImageName) {
|
68 | 62 | serverPassword = DEFAULT_SERVER_PASSWORD;
|
69 | 63 | databaseName = DEFAULT_DATABASE_NAME;
|
70 | 64 |
|
71 |
| - WaitStrategy waitForHttp = new HttpWaitStrategy() |
72 |
| - .forPort(DEFAULT_HTTP_PORT) |
73 |
| - .forStatusCodeMatching(response -> response == HTTP_OK); |
74 |
| - |
75 |
| - waitStrategy = new WaitAllStrategy() |
76 |
| - .withStrategy(Wait.forListeningPort()) |
77 |
| - .withStrategy(waitForHttp) |
78 |
| - .withStartupTimeout(Duration.ofMinutes(2)); |
| 65 | + waitStrategy = new LogMessageWaitStrategy().withRegEx(".*Gremlin started correctly.*"); |
79 | 66 |
|
80 | 67 | addExposedPorts(DEFAULT_BINARY_PORT, DEFAULT_HTTP_PORT);
|
81 | 68 | }
|
|
0 commit comments