re-enable testcontainers

This commit is contained in:
Tom Hombergs
2020-08-08 17:29:29 +10:00
parent 22193d8c28
commit dbc126e49e
2 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
package io.reflectoring.cache;
import org.junit.jupiter.api.BeforeAll;
import org.testcontainers.containers.FixedHostPortGenericContainer;
import org.testcontainers.containers.GenericContainer;
public class AbstractIntegrationTest {
static GenericContainer firstMember =
new FixedHostPortGenericContainer("hazelcast/hazelcast:4.0.1")
.withFixedExposedPort(5701, 5701);
static GenericContainer secondMember =
new FixedHostPortGenericContainer("hazelcast/hazelcast:4.0.1")
.withFixedExposedPort(5702, 5701);
@BeforeAll
public static void init() {
firstMember.start();
secondMember.start();
}
}

View File

@@ -2,6 +2,7 @@ package io.reflectoring.cache.rest;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.reflectoring.cache.AbstractIntegrationTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
@@ -16,7 +17,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("client")
class CarResourceClientCacheIntegrationTest {
class CarResourceClientCacheIntegrationTest extends AbstractIntegrationTest {
@Autowired
private MockMvc mockMvc;