Do not listen for Kafka/Zookeeper on fixed ports
Change-Id: I89631dcd34b5b4057a8f90a8397989b9b4a4614c
diff --git a/src/test/java/com/googlesource/gerrit/plugins/kafka/api/KafkaBrokerApiTest.java b/src/test/java/com/googlesource/gerrit/plugins/kafka/api/KafkaBrokerApiTest.java
index 64a2973..fab4d3b 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/kafka/api/KafkaBrokerApiTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/kafka/api/KafkaBrokerApiTest.java
@@ -67,18 +67,6 @@
private KafkaSession session;
private Gson gson;
- public static class TestKafkaContainer extends KafkaContainer {
- public TestKafkaContainer() {
- addFixedExposedPort(KAFKA_PORT, KAFKA_PORT);
- addFixedExposedPort(ZOOKEEPER_PORT, ZOOKEEPER_PORT);
- }
-
- @Override
- public String getBootstrapServers() {
- return String.format("PLAINTEXT://%s:%s", getContainerIpAddress(), KAFKA_PORT);
- }
- }
-
public static class TestWorkQueue extends WorkQueue {
@Inject
@@ -143,7 +131,7 @@
@BeforeClass
public static void beforeClass() throws Exception {
- kafka = new TestKafkaContainer();
+ kafka = new KafkaContainer();
kafka.start();
System.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, kafka.getBootstrapServers());
}