Skip to content

Commit dbc126e

Browse files
committed
re-enable testcontainers
1 parent 22193d8 commit dbc126e

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package io.reflectoring.cache;
2+
3+
import org.junit.jupiter.api.BeforeAll;
4+
import org.testcontainers.containers.FixedHostPortGenericContainer;
5+
import org.testcontainers.containers.GenericContainer;
6+
7+
public class AbstractIntegrationTest {
8+
9+
static GenericContainer firstMember =
10+
new FixedHostPortGenericContainer("hazelcast/hazelcast:4.0.1")
11+
.withFixedExposedPort(5701, 5701);
12+
13+
static GenericContainer secondMember =
14+
new FixedHostPortGenericContainer("hazelcast/hazelcast:4.0.1")
15+
.withFixedExposedPort(5702, 5701);
16+
17+
@BeforeAll
18+
public static void init() {
19+
firstMember.start();
20+
secondMember.start();
21+
}
22+
}

spring-boot/cache/src/test/java/io/reflectoring/cache/rest/CarResourceClientCacheIntegrationTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
import com.fasterxml.jackson.databind.ObjectMapper;
5+
import io.reflectoring.cache.AbstractIntegrationTest;
56
import org.junit.jupiter.api.Test;
67
import org.springframework.beans.factory.annotation.Autowired;
78
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
@@ -16,7 +17,7 @@
1617
@SpringBootTest
1718
@AutoConfigureMockMvc
1819
@ActiveProfiles("client")
19-
class CarResourceClientCacheIntegrationTest {
20+
class CarResourceClientCacheIntegrationTest extends AbstractIntegrationTest {
2021

2122
@Autowired
2223
private MockMvc mockMvc;

0 commit comments

Comments
 (0)