Skip to content

Commit 4737849

Browse files
committed
2 parents 8ff7dde + 927e19e commit 4737849

File tree

2 files changed

+6
-26
lines changed

2 files changed

+6
-26
lines changed

pom.xml

+1-15
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<properties>
1212
<maven.compiler.source>11</maven.compiler.source>
1313
<maven.compiler.target>11</maven.compiler.target>
14+
<maven.compiler.release>11</maven.compiler.release>
1415
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1516
<caffeine.version>3.1.8</caffeine.version>
16-
<mysql-connector.version>8.4.0</mysql-connector.version>
1717
<okhttp.version>4.12.0</okhttp.version>
1818
<protobuf.version>4.27.2</protobuf.version>
1919
<grpc.version>1.65.0</grpc.version>
@@ -99,20 +99,6 @@
9999
<version>${logback-classic.version}</version>
100100
<scope>test</scope>
101101
</dependency>
102-
103-
<dependency>
104-
<groupId>org.testcontainers</groupId>
105-
<artifactId>mysql</artifactId>
106-
<version>${testcontainers.version}</version>
107-
<scope>test</scope>
108-
</dependency>
109-
110-
<dependency>
111-
<groupId>com.mysql</groupId>
112-
<artifactId>mysql-connector-j</artifactId>
113-
<version>${mysql-connector.version}</version>
114-
<scope>test</scope>
115-
</dependency>
116102
</dependencies>
117103

118104
<build>

src/test/java/io/eigr/spawn/AbstractContainerBaseTest.java

+5-11
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111
import io.eigr.spawn.test.actors.JoeActor;
1212
import io.eigr.spawn.test.actors.StatelessNamedActor;
1313
import io.eigr.spawn.test.actors.UnNamedActor;
14-
import org.junit.jupiter.api.AfterAll;
15-
import org.junit.jupiter.api.BeforeAll;
1614
import org.slf4j.Logger;
1715
import org.slf4j.LoggerFactory;
1816
import org.testcontainers.Testcontainers;
1917
import org.testcontainers.containers.GenericContainer;
18+
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
2019
import org.testcontainers.utility.DockerImageName;
2120

22-
abstract class AbstractContainerBaseTest {
21+
public abstract class AbstractContainerBaseTest {
2322

2423
private static final Logger log = LoggerFactory.getLogger(AbstractContainerBaseTest.class);
2524
private static GenericContainer<?> SPAWN_CONTAINER;
@@ -29,13 +28,14 @@ abstract class AbstractContainerBaseTest {
2928
protected static Spawn spawnSystem;
3029
protected static final String spawnSystemName = "spawn-system-test";
3130

32-
@BeforeAll
33-
public static void setup() {
31+
static {
3432
Testcontainers.exposeHostPorts(8091);
3533

3634
SPAWN_CONTAINER = new GenericContainer<>(DockerImageName.parse(spawnProxyImage))
3735
.withCreateContainerCmdModifier(e -> e.withHostConfig(HostConfig.newHostConfig()
3836
.withPortBindings(PortBinding.parse("9004:9004"))))
37+
.waitingFor(new LogMessageWaitStrategy()
38+
.withRegEx(".*Proxy Application started successfully.*"))
3939
.withEnv("SPAWN_PROXY_LOGGER_LEVEL", "DEBUG")
4040
.withEnv("SPAWN_STATESTORE_KEY", "3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE=")
4141
.withEnv("PROXY_ACTOR_SYSTEM_NAME", spawnSystemName)
@@ -76,11 +76,5 @@ public static void setup() {
7676
throw new RuntimeException(e);
7777
}
7878
}
79-
80-
@AfterAll
81-
public static void teardown() {
82-
SPAWN_CONTAINER.stop();
83-
84-
}
8579
}
8680

0 commit comments

Comments
 (0)