@@ -62,11 +62,7 @@ public void basicProducerShouldConnectToKafka() throws Exception {
62
62
63
63
final File yml = new File (Resources .getResource ("yaml/integration/basic-producer.yaml" ).toURI ());
64
64
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 ("," )));
70
66
final LifecycleEnvironment lifecycle = new LifecycleEnvironment (metrics );
71
67
final HealthCheckRegistry healthChecks = new HealthCheckRegistry ();
72
68
@@ -90,11 +86,7 @@ public void basicProducerShouldConnectToKafka() throws Exception {
90
86
public void basicConsumerShouldConnectToKafka () throws Exception {
91
87
final File yml = new File (Resources .getResource ("yaml/integration/basic-consumer.yaml" ).toURI ());
92
88
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 ("," )));
98
90
final LifecycleEnvironment lifecycle = new LifecycleEnvironment (metrics );
99
91
final HealthCheckRegistry healthChecks = new HealthCheckRegistry ();
100
92
@@ -111,11 +103,7 @@ public void basicConsumerShouldConnectToKafka() throws Exception {
111
103
public void basicAdminShouldCreateTopics () throws Exception {
112
104
final File yml = new File (Resources .getResource ("yaml/integration/basic-admin.yaml" ).toURI ());
113
105
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 ("," )));
119
107
final LifecycleEnvironment lifecycle = new LifecycleEnvironment (metrics );
120
108
final HealthCheckRegistry healthChecks = new HealthCheckRegistry ();
121
109
0 commit comments