diff --git a/samples/sample-05/README.adoc b/samples/sample-05/README.adoc index b132450a..e4be54b9 100644 --- a/samples/sample-05/README.adoc +++ b/samples/sample-05/README.adoc @@ -7,11 +7,13 @@ Additional properties for the underlying `GlobalEmbeddedKafkaTestExecutionListen Run only `./mvnw test` command for this sample. The Maven will report to the output similar two log messages: -``` + +[source,text] +---- 11:03:44.383 [main] INFO o.s.k.t.j.GlobalEmbeddedKafkaTestExecutionListener - Started global Embedded Kafka on: 127.0.0.1:53671 ... 11:03:48.439 [main] INFO o.s.k.t.j.GlobalEmbeddedKafkaTestExecutionListener - Stopped global Embedded Kafka. -``` +---- One in the beginning of the test plan - and another in the end before reporting failures. The application by itself is going to fail because it has a configuration like `spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}`. diff --git a/samples/sample-05/src/main/resources/application.properties b/samples/sample-05/src/main/resources/application.properties index 480254ee..e2327d8f 100644 --- a/samples/sample-05/src/main/resources/application.properties +++ b/samples/sample-05/src/main/resources/application.properties @@ -1,4 +1,3 @@ -spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers} spring.kafka.producer.properties[max.block.ms]=1000 spring.kafka.consumer.auto-offset-reset=earliest logging.level.root=error diff --git a/samples/sample-05/src/test/java/com/example/Sample05Application1Tests.java b/samples/sample-05/src/test/java/com/example/Sample05Application1Tests.java index e5cc650f..8c61d12f 100644 --- a/samples/sample-05/src/test/java/com/example/Sample05Application1Tests.java +++ b/samples/sample-05/src/test/java/com/example/Sample05Application1Tests.java @@ -29,7 +29,7 @@ import org.springframework.kafka.core.KafkaTemplate; import org.springframework.test.annotation.DirtiesContext; /** - * This test is going to fail from IDE since there is no exposed {@code spring.embedded.kafka.brokers} system property. + * This test is going to fail from IDE since there is no exposed {@code spring.kafka.bootstrap-servers} system property. * Use Maven to run tests which enables global embedded Kafka broker via properties provided to Surefire plugin. */ @ExtendWith(OutputCaptureExtension.class) diff --git a/samples/sample-05/src/test/java/com/example/Sample05Application2Tests.java b/samples/sample-05/src/test/java/com/example/Sample05Application2Tests.java index b49c673a..6a567a66 100644 --- a/samples/sample-05/src/test/java/com/example/Sample05Application2Tests.java +++ b/samples/sample-05/src/test/java/com/example/Sample05Application2Tests.java @@ -30,7 +30,7 @@ import org.springframework.kafka.core.KafkaTemplate; import org.springframework.test.annotation.DirtiesContext; /** - * This test is going to fail from IDE since there is no exposed {@code spring.embedded.kafka.brokers} system property. + * This test is going to fail from IDE since there is no exposed {@code spring.kafka.bootstrap-servers} system property. * This test demonstrates that global embedded Kafka broker config for {@code auto.create.topics.enable=false} * is in an effect - the topic {@code nonExistingTopic} does not exist on the broker. * See {@code /resources/kafka-broker.properties} and Maven Surefire plugin configuration.