19
19
import java .io .File ;
20
20
import java .util .Collections ;
21
21
import java .util .HashMap ;
22
+ import java .util .List ;
22
23
import java .util .Map ;
23
24
import java .util .Properties ;
24
25
@@ -289,6 +290,7 @@ public void adminProperties() {
289
290
});
290
291
}
291
292
293
+ @ SuppressWarnings ("unchecked" )
292
294
@ Test
293
295
public void streamsProperties () {
294
296
this .contextRunner .withUserConfiguration (EnableKafkaStreamsConfiguration .class )
@@ -314,15 +316,16 @@ public void streamsProperties() {
314
316
Properties configs = context .getBean (
315
317
KafkaStreamsDefaultConfiguration .DEFAULT_STREAMS_CONFIG_BEAN_NAME ,
316
318
KafkaStreamsConfiguration .class ).asProperties ();
317
- assertThat (configs .get (StreamsConfig .BOOTSTRAP_SERVERS_CONFIG ))
318
- .isEqualTo ("localhost:9092, localhost:9093" );
319
+ assertThat ((List <String >) configs
320
+ .get (StreamsConfig .BOOTSTRAP_SERVERS_CONFIG ))
321
+ .containsExactly ("localhost:9092" , "localhost:9093" );
319
322
assertThat (
320
323
configs .get (StreamsConfig .CACHE_MAX_BYTES_BUFFERING_CONFIG ))
321
- .isEqualTo (" 1024" );
324
+ .isEqualTo (1024 );
322
325
assertThat (configs .get (StreamsConfig .CLIENT_ID_CONFIG ))
323
326
.isEqualTo ("override" );
324
327
assertThat (configs .get (StreamsConfig .REPLICATION_FACTOR_CONFIG ))
325
- .isEqualTo ("2" );
328
+ .isEqualTo (2 );
326
329
assertThat (configs .get (StreamsConfig .STATE_DIR_CONFIG ))
327
330
.isEqualTo ("/tmp/state" );
328
331
assertThat (configs .get (SslConfigs .SSL_KEY_PASSWORD_CONFIG ))
@@ -354,6 +357,7 @@ public void streamsProperties() {
354
357
});
355
358
}
356
359
360
+ @ SuppressWarnings ("unchecked" )
357
361
@ Test
358
362
public void streamsApplicationIdUsesMainApplicationNameByDefault () {
359
363
this .contextRunner .withUserConfiguration (EnableKafkaStreamsConfiguration .class )
@@ -364,8 +368,9 @@ public void streamsApplicationIdUsesMainApplicationNameByDefault() {
364
368
Properties configs = context .getBean (
365
369
KafkaStreamsDefaultConfiguration .DEFAULT_STREAMS_CONFIG_BEAN_NAME ,
366
370
KafkaStreamsConfiguration .class ).asProperties ();
367
- assertThat (configs .get (StreamsConfig .BOOTSTRAP_SERVERS_CONFIG ))
368
- .isEqualTo ("localhost:9092, localhost:9093" );
371
+ assertThat ((List <String >) configs
372
+ .get (StreamsConfig .BOOTSTRAP_SERVERS_CONFIG ))
373
+ .containsExactly ("localhost:9092" , "localhost:9093" );
369
374
assertThat (configs .get (StreamsConfig .APPLICATION_ID_CONFIG ))
370
375
.isEqualTo ("my-test-app" );
371
376
});
@@ -390,6 +395,7 @@ public void streamsWithCustomKafkaConfiguration() {
390
395
});
391
396
}
392
397
398
+ @ SuppressWarnings ("unchecked" )
393
399
@ Test
394
400
public void streamsWithSeveralStreamsBuilderFactoryBeans () {
395
401
this .contextRunner
@@ -402,8 +408,9 @@ public void streamsWithSeveralStreamsBuilderFactoryBeans() {
402
408
Properties configs = context .getBean (
403
409
KafkaStreamsDefaultConfiguration .DEFAULT_STREAMS_CONFIG_BEAN_NAME ,
404
410
KafkaStreamsConfiguration .class ).asProperties ();
405
- assertThat (configs .get (StreamsConfig .BOOTSTRAP_SERVERS_CONFIG ))
406
- .isEqualTo ("localhost:9092, localhost:9093" );
411
+ assertThat ((List <String >) configs
412
+ .get (StreamsConfig .BOOTSTRAP_SERVERS_CONFIG ))
413
+ .containsExactly ("localhost:9092" , "localhost:9093" );
407
414
verify (context .getBean ("&firstStreamsBuilderFactoryBean" ,
408
415
StreamsBuilderFactoryBean .class ), never ())
409
416
.setAutoStartup (false );
0 commit comments