|
40 | 40 | import org.junit.platform.suite.api.SelectClasses; |
41 | 41 | import org.junit.platform.suite.api.Suite; |
42 | 42 | import org.testcontainers.kafka.KafkaContainer; |
| 43 | +import org.testcontainers.containers.GenericContainer; |
43 | 44 | import org.testcontainers.utility.DockerImageName; |
44 | 45 |
|
45 | 46 | import com.github.tomakehurst.wiremock.WireMockServer; |
@@ -98,9 +99,15 @@ public class StorageTestSuite { |
98 | 99 | private static MockServer mockServer; |
99 | 100 | private static final WireMockServer wireMockServer = new WireMockServer(PROXY_PORT); |
100 | 101 |
|
101 | | - private static final KafkaContainer kafkaContainer = new KafkaContainer(DockerImageName.parse("apache/kafka-native:3.8.0")) |
| 102 | + private static final KafkaContainer kafkaContainer = new KafkaContainer(DockerImageName.parse("apache/kafka-native:4.2.0")) |
102 | 103 | .withStartupAttempts(3); |
103 | 104 |
|
| 105 | + @SuppressWarnings("resource") |
| 106 | + private static final GenericContainer<?> sidecarContainer = new GenericContainer<>( |
| 107 | + DockerImageName.parse("folioci/folio-module-sidecar:latest")) |
| 108 | + .withExposedPorts(8081) |
| 109 | + .withNetworkAliases("folio-module-sidecar"); |
| 110 | + |
104 | 111 | /** |
105 | 112 | * Return a URL for the path and the parameters. |
106 | 113 | * |
@@ -152,6 +159,7 @@ public static void before() throws InterruptedException, |
152 | 159 | PostgresClient.setPostgresTester(new PostgresTesterContainer()); |
153 | 160 |
|
154 | 161 | kafkaContainer.start(); |
| 162 | + sidecarContainer.start(); |
155 | 163 | var host = kafkaContainer.getHost(); |
156 | 164 | var port = String.valueOf(kafkaContainer.getFirstMappedPort()); |
157 | 165 | log.info("Starting Kafka host={} port={}", host, port); |
@@ -202,6 +210,12 @@ public static void after() |
202 | 210 | log.warn("after:: kafkaContainer.stop() failed (ignored): {}", e.getMessage()); |
203 | 211 | } |
204 | 212 |
|
| 213 | + try { |
| 214 | + sidecarContainer.stop(); |
| 215 | + } catch (Throwable e) { |
| 216 | + log.warn("after:: sidecarContainer.stop() failed (ignored): {}", e.getMessage()); |
| 217 | + } |
| 218 | + |
205 | 219 | try { |
206 | 220 | mockServer.close(); |
207 | 221 | } catch (Throwable e) { |
|
0 commit comments