Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sleipnir committed Aug 2, 2024
2 parents 8ff7dde + 927e19e commit 4737849
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
16 changes: 1 addition & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<caffeine.version>3.1.8</caffeine.version>
<mysql-connector.version>8.4.0</mysql-connector.version>
<okhttp.version>4.12.0</okhttp.version>
<protobuf.version>4.27.2</protobuf.version>
<grpc.version>1.65.0</grpc.version>
Expand Down Expand Up @@ -99,20 +99,6 @@
<version>${logback-classic.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql-connector.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
16 changes: 5 additions & 11 deletions src/test/java/io/eigr/spawn/AbstractContainerBaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
import io.eigr.spawn.test.actors.JoeActor;
import io.eigr.spawn.test.actors.StatelessNamedActor;
import io.eigr.spawn.test.actors.UnNamedActor;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.Testcontainers;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.utility.DockerImageName;

abstract class AbstractContainerBaseTest {
public abstract class AbstractContainerBaseTest {

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

@BeforeAll
public static void setup() {
static {
Testcontainers.exposeHostPorts(8091);

SPAWN_CONTAINER = new GenericContainer<>(DockerImageName.parse(spawnProxyImage))
.withCreateContainerCmdModifier(e -> e.withHostConfig(HostConfig.newHostConfig()
.withPortBindings(PortBinding.parse("9004:9004"))))
.waitingFor(new LogMessageWaitStrategy()
.withRegEx(".*Proxy Application started successfully.*"))
.withEnv("SPAWN_PROXY_LOGGER_LEVEL", "DEBUG")
.withEnv("SPAWN_STATESTORE_KEY", "3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE=")
.withEnv("PROXY_ACTOR_SYSTEM_NAME", spawnSystemName)
Expand Down Expand Up @@ -76,11 +76,5 @@ public static void setup() {
throw new RuntimeException(e);
}
}

@AfterAll
public static void teardown() {
SPAWN_CONTAINER.stop();

}
}

0 comments on commit 4737849

Please sign in to comment.