File tree Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Expand file tree Collapse file tree 4 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,13 @@ Additional properties for the underlying `GlobalEmbeddedKafkaTestExecutionListen
7
7
8
8
Run only `./mvnw test` command for this sample.
9
9
The Maven will report to the output similar two log messages:
10
- ```
10
+
11
+ [source,text]
12
+ ----
11
13
11:03:44.383 [main] INFO o.s.k.t.j.GlobalEmbeddedKafkaTestExecutionListener - Started global Embedded Kafka on: 127.0.0.1:53671
12
14
...
13
15
11:03:48.439 [main] INFO o.s.k.t.j.GlobalEmbeddedKafkaTestExecutionListener - Stopped global Embedded Kafka.
14
- ```
16
+ ----
15
17
One in the beginning of the test plan - and another in the end before reporting failures.
16
18
17
19
The application by itself is going to fail because it has a configuration like `spring.kafka.bootstrap-servers=${spring.embedded.kafka.brokers}` .
Original file line number Diff line number Diff line change 1
- spring.kafka.bootstrap-servers =${spring.embedded.kafka.brokers}
2
1
spring.kafka.producer.properties[max.block.ms]=1000
3
2
spring.kafka.consumer.auto-offset-reset =earliest
4
3
logging.level.root =error
Original file line number Diff line number Diff line change 29
29
import org .springframework .test .annotation .DirtiesContext ;
30
30
31
31
/**
32
- * This test is going to fail from IDE since there is no exposed {@code spring.embedded. kafka.brokers } system property.
32
+ * This test is going to fail from IDE since there is no exposed {@code spring.kafka.bootstrap-servers } system property.
33
33
* Use Maven to run tests which enables global embedded Kafka broker via properties provided to Surefire plugin.
34
34
*/
35
35
@ ExtendWith (OutputCaptureExtension .class )
Original file line number Diff line number Diff line change 30
30
import org .springframework .test .annotation .DirtiesContext ;
31
31
32
32
/**
33
- * This test is going to fail from IDE since there is no exposed {@code spring.embedded. kafka.brokers } system property.
33
+ * This test is going to fail from IDE since there is no exposed {@code spring.kafka.bootstrap-servers } system property.
34
34
* This test demonstrates that global embedded Kafka broker config for {@code auto.create.topics.enable=false}
35
35
* is in an effect - the topic {@code nonExistingTopic} does not exist on the broker.
36
36
* See {@code /resources/kafka-broker.properties} and Maven Surefire plugin configuration.
You can’t perform that action at this time.
0 commit comments