11
11
import io .eigr .spawn .test .actors .JoeActor ;
12
12
import io .eigr .spawn .test .actors .StatelessNamedActor ;
13
13
import io .eigr .spawn .test .actors .UnNamedActor ;
14
- import org .junit .jupiter .api .AfterAll ;
15
- import org .junit .jupiter .api .BeforeAll ;
16
14
import org .slf4j .Logger ;
17
15
import org .slf4j .LoggerFactory ;
18
16
import org .testcontainers .Testcontainers ;
19
17
import org .testcontainers .containers .GenericContainer ;
18
+ import org .testcontainers .containers .wait .strategy .LogMessageWaitStrategy ;
20
19
import org .testcontainers .utility .DockerImageName ;
21
20
22
- abstract class AbstractContainerBaseTest {
21
+ public abstract class AbstractContainerBaseTest {
23
22
24
23
private static final Logger log = LoggerFactory .getLogger (AbstractContainerBaseTest .class );
25
24
private static GenericContainer <?> SPAWN_CONTAINER ;
@@ -29,13 +28,14 @@ abstract class AbstractContainerBaseTest {
29
28
protected static Spawn spawnSystem ;
30
29
protected static final String spawnSystemName = "spawn-system-test" ;
31
30
32
- @ BeforeAll
33
- public static void setup () {
31
+ static {
34
32
Testcontainers .exposeHostPorts (8091 );
35
33
36
34
SPAWN_CONTAINER = new GenericContainer <>(DockerImageName .parse (spawnProxyImage ))
37
35
.withCreateContainerCmdModifier (e -> e .withHostConfig (HostConfig .newHostConfig ()
38
36
.withPortBindings (PortBinding .parse ("9004:9004" ))))
37
+ .waitingFor (new LogMessageWaitStrategy ()
38
+ .withRegEx (".*Proxy Application started successfully.*" ))
39
39
.withEnv ("SPAWN_PROXY_LOGGER_LEVEL" , "DEBUG" )
40
40
.withEnv ("SPAWN_STATESTORE_KEY" , "3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE=" )
41
41
.withEnv ("PROXY_ACTOR_SYSTEM_NAME" , spawnSystemName )
@@ -76,11 +76,5 @@ public static void setup() {
76
76
throw new RuntimeException (e );
77
77
}
78
78
}
79
-
80
- @ AfterAll
81
- public static void teardown () {
82
- SPAWN_CONTAINER .stop ();
83
-
84
- }
85
79
}
86
80
0 commit comments