Skip to content

Commit b8580af

Browse files
committed
Fix DropwizardKafkaIT
1 parent 356deb7 commit b8580af

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/test/java/io/dropwizard/kafka/integration/DropwizardKafkaIT.java

+3-15
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ public void basicProducerShouldConnectToKafka() throws Exception {
6262

6363
final File yml = new File(Resources.getResource("yaml/integration/basic-producer.yaml").toURI());
6464
final KafkaProducerFactory<String, String> factory = producerConfigFactory.build(yml);
65-
factory.setBootstrapServers(
66-
Arrays.stream(kafka.getEmbeddedKafka().getBrokerAddresses())
67-
.map(BrokerAddress::toString)
68-
.collect(Collectors.toSet())
69-
);
65+
factory.setBootstrapServers(Set.of(kafka.getEmbeddedKafka().getBrokerAddresses().split(",")));
7066
final LifecycleEnvironment lifecycle = new LifecycleEnvironment(metrics);
7167
final HealthCheckRegistry healthChecks = new HealthCheckRegistry();
7268

@@ -90,11 +86,7 @@ public void basicProducerShouldConnectToKafka() throws Exception {
9086
public void basicConsumerShouldConnectToKafka() throws Exception {
9187
final File yml = new File(Resources.getResource("yaml/integration/basic-consumer.yaml").toURI());
9288
final KafkaConsumerFactory factory = consumerConfigFactory.build(yml);
93-
factory.setBootstrapServers(
94-
Arrays.stream(kafka.getEmbeddedKafka().getBrokerAddresses())
95-
.map(BrokerAddress::toString)
96-
.collect(Collectors.toSet())
97-
);
89+
factory.setBootstrapServers(Set.of(kafka.getEmbeddedKafka().getBrokerAddresses().split(",")));
9890
final LifecycleEnvironment lifecycle = new LifecycleEnvironment(metrics);
9991
final HealthCheckRegistry healthChecks = new HealthCheckRegistry();
10092

@@ -111,11 +103,7 @@ public void basicConsumerShouldConnectToKafka() throws Exception {
111103
public void basicAdminShouldCreateTopics() throws Exception {
112104
final File yml = new File(Resources.getResource("yaml/integration/basic-admin.yaml").toURI());
113105
final KafkaAdminClientFactory factory = adminTopicConfigFactory.build(yml);
114-
factory.setBootstrapServers(
115-
Arrays.stream(kafka.getEmbeddedKafka().getBrokerAddresses())
116-
.map(BrokerAddress::toString)
117-
.collect(Collectors.toSet())
118-
);
106+
factory.setBootstrapServers(Set.of(kafka.getEmbeddedKafka().getBrokerAddresses().split(",")));
119107
final LifecycleEnvironment lifecycle = new LifecycleEnvironment(metrics);
120108
final HealthCheckRegistry healthChecks = new HealthCheckRegistry();
121109

0 commit comments

Comments
 (0)