Handle Kafka servers as strings and rely on Kafka's parsing
Closes gh-34770
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.kafka;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
import org.testcontainers.containers.KafkaContainer;
|
||||
@@ -53,9 +52,8 @@ class KafkaContainerConnectionDetailsFactory
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Node> getBootstrapNodes() {
|
||||
URI uri = URI.create(getContainer().getBootstrapServers());
|
||||
return List.of(new Node(uri.getHost(), uri.getPort()));
|
||||
public List<String> getBootstrapServers() {
|
||||
return List.of(getContainer().getBootstrapServers());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.springframework.boot.testcontainers.service.connection.redpanda;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
||||
import org.testcontainers.redpanda.RedpandaContainer;
|
||||
@@ -52,9 +51,8 @@ class RedpandaContainerConnectionDetailsFactory
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Node> getBootstrapNodes() {
|
||||
URI uri = URI.create(getContainer().getBootstrapServers());
|
||||
return List.of(new Node(uri.getHost(), uri.getPort()));
|
||||
public List<String> getBootstrapServers() {
|
||||
return List.of(getContainer().getBootstrapServers());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user