Skip to content

Commit 4343f82

Browse files
authored
Merge pull request #304 from OpenLiberty/staging
Merge staging to prod: Fix daily build failure
2 parents 18dd868 + 5a05622 commit 4343f82

File tree

4 files changed

+24
-28
lines changed

4 files changed

+24
-28
lines changed

finish/inventory/src/test/java/it/io/openliberty/guides/inventory/InventoryServiceIT.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2020, 2024 IBM Corporation and others.
3+
* Copyright (c) 2020, 2025 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
@@ -42,13 +42,12 @@
4242
import org.slf4j.Logger;
4343
import org.slf4j.LoggerFactory;
4444
import org.testcontainers.containers.GenericContainer;
45-
import org.testcontainers.containers.KafkaContainer;
4645
import org.testcontainers.containers.Network;
4746
import org.testcontainers.containers.output.Slf4jLogConsumer;
4847
import org.testcontainers.containers.wait.strategy.Wait;
4948
import org.testcontainers.images.builder.ImageFromDockerfile;
5049
import org.testcontainers.junit.jupiter.Testcontainers;
51-
import org.testcontainers.utility.DockerImageName;
50+
import org.testcontainers.kafka.ConfluentKafkaContainer;
5251

5352
import io.openliberty.guides.models.SystemLoad;
5453
import io.openliberty.guides.models.SystemLoad.SystemLoadSerializer;
@@ -74,13 +73,13 @@ public class InventoryServiceIT {
7473
new ImageFromDockerfile("inventory:1.0-SNAPSHOT")
7574
.withDockerfile(Paths.get("./Dockerfile"));
7675

77-
private static KafkaContainer kafkaContainer =
78-
new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:latest"))
79-
.withListener(() -> "kafka:19092")
76+
private static ConfluentKafkaContainer kafkaContainer =
77+
new ConfluentKafkaContainer("confluentinc/cp-kafka:latest")
78+
.withListener("kafka:19092")
8079
.withNetwork(network);
8180

8281
private static GenericContainer<?> inventoryContainer =
83-
new GenericContainer(inventoryImage)
82+
new GenericContainer<>(inventoryImage)
8483
.withNetwork(network)
8584
.withExposedPorts(9085)
8685
.waitingFor(Wait.forHttp("/health/ready").forPort(9085))

finish/system/src/test/java/it/io/openliberty/guides/system/SystemServiceIT.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2020, 2024 IBM Corporation and others.
3+
* Copyright (c) 2020, 2025 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
@@ -30,13 +30,12 @@
3030
import static org.junit.jupiter.api.Assertions.assertNotNull;
3131
import static org.junit.jupiter.api.Assertions.assertTrue;
3232

33-
import org.testcontainers.containers.KafkaContainer;
3433
import org.testcontainers.containers.Network;
3534
import org.testcontainers.containers.wait.strategy.Wait;
3635
import org.testcontainers.images.builder.ImageFromDockerfile;
3736
import org.testcontainers.containers.GenericContainer;
3837
import org.testcontainers.containers.output.Slf4jLogConsumer;
39-
import org.testcontainers.utility.DockerImageName;
38+
import org.testcontainers.kafka.ConfluentKafkaContainer;
4039

4140
import org.apache.kafka.clients.consumer.ConsumerConfig;
4241
import org.apache.kafka.clients.consumer.ConsumerRecord;
@@ -70,13 +69,13 @@ public class SystemServiceIT {
7069
new ImageFromDockerfile("system:1.0-SNAPSHOT")
7170
.withDockerfile(Paths.get("./Dockerfile"));
7271

73-
private static KafkaContainer kafkaContainer =
74-
new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:latest"))
75-
.withListener(() -> "kafka:19092")
72+
private static ConfluentKafkaContainer kafkaContainer =
73+
new ConfluentKafkaContainer("confluentinc/cp-kafka:latest")
74+
.withListener("kafka:19092")
7675
.withNetwork(network);
7776

7877
private static GenericContainer<?> systemContainer =
79-
new GenericContainer(systemImage)
78+
new GenericContainer<>(systemImage)
8079
.withNetwork(network)
8180
.withExposedPorts(9083)
8281
.waitingFor(Wait.forHttp("/health/ready").forPort(9083))

start/inventory/src/test/java/it/io/openliberty/guides/inventory/InventoryServiceIT.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2020, 2024 IBM Corporation and others.
3+
* Copyright (c) 2020, 2025 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
@@ -36,7 +36,6 @@
3636
import static org.junit.jupiter.api.Assertions.assertTrue;
3737

3838
import org.testcontainers.containers.Network;
39-
import org.testcontainers.utility.DockerImageName;
4039

4140
import org.apache.kafka.clients.producer.ProducerRecord;
4241
import org.apache.kafka.clients.producer.ProducerConfig;
@@ -46,12 +45,12 @@
4645
import org.apache.kafka.clients.consumer.ConsumerRecords;
4746
import org.apache.kafka.clients.consumer.ConsumerConfig;
4847

49-
import org.testcontainers.containers.KafkaContainer;
5048
import org.testcontainers.containers.GenericContainer;
5149
import org.testcontainers.junit.jupiter.Testcontainers;
5250
import org.testcontainers.images.builder.ImageFromDockerfile;
5351
import org.testcontainers.containers.wait.strategy.Wait;
5452
import org.testcontainers.containers.output.Slf4jLogConsumer;
53+
import org.testcontainers.kafka.ConfluentKafkaContainer;
5554

5655
import org.apache.kafka.common.serialization.StringSerializer;
5756
import org.apache.kafka.common.serialization.StringDeserializer;
@@ -79,13 +78,13 @@ public class InventoryServiceIT {
7978
new ImageFromDockerfile("inventory:1.0-SNAPSHOT")
8079
.withDockerfile(Paths.get("./Dockerfile"));
8180

82-
private static KafkaContainer kafkaContainer =
83-
new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:latest"))
84-
.withListener(() -> "kafka:19092")
81+
private static ConfluentKafkaContainer kafkaContainer =
82+
new ConfluentKafkaContainer("confluentinc/cp-kafka:latest")
83+
.withListener("kafka:19092")
8584
.withNetwork(network);
8685

8786
private static GenericContainer<?> inventoryContainer =
88-
new GenericContainer(inventoryImage)
87+
new GenericContainer<>(inventoryImage)
8988
.withNetwork(network)
9089
.withExposedPorts(9085)
9190
.waitingFor(Wait.forHttp("/health/ready").forPort(9085))

start/system/src/test/java/it/io/openliberty/guides/system/SystemServiceIT.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// tag::copyright[]
22
/*******************************************************************************
3-
* Copyright (c) 2020, 2024 IBM Corporation and others.
3+
* Copyright (c) 2020, 2025 IBM Corporation and others.
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
66
* which accompanies this distribution, and is available at
@@ -30,13 +30,12 @@
3030
import static org.junit.jupiter.api.Assertions.assertNotNull;
3131
import static org.junit.jupiter.api.Assertions.assertTrue;
3232

33-
import org.testcontainers.containers.KafkaContainer;
3433
import org.testcontainers.containers.Network;
3534
import org.testcontainers.containers.wait.strategy.Wait;
3635
import org.testcontainers.images.builder.ImageFromDockerfile;
3736
import org.testcontainers.containers.GenericContainer;
3837
import org.testcontainers.containers.output.Slf4jLogConsumer;
39-
import org.testcontainers.utility.DockerImageName;
38+
import org.testcontainers.kafka.ConfluentKafkaContainer;
4039

4140
import org.apache.kafka.clients.consumer.ConsumerConfig;
4241
import org.apache.kafka.clients.consumer.ConsumerRecord;
@@ -70,13 +69,13 @@ public class SystemServiceIT {
7069
new ImageFromDockerfile("system:1.0-SNAPSHOT")
7170
.withDockerfile(Paths.get("./Dockerfile"));
7271

73-
private static KafkaContainer kafkaContainer =
74-
new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:latest"))
75-
.withListener(() -> "kafka:19092")
72+
private static ConfluentKafkaContainer kafkaContainer =
73+
new ConfluentKafkaContainer("confluentinc/cp-kafka:latest")
74+
.withListener("kafka:19092")
7675
.withNetwork(network);
7776

7877
private static GenericContainer<?> systemContainer =
79-
new GenericContainer(systemImage)
78+
new GenericContainer<>(systemImage)
8079
.withNetwork(network)
8180
.withExposedPorts(9083)
8281
.waitingFor(Wait.forHttp("/health/ready").forPort(9083))

0 commit comments

Comments
 (0)