Skip to content

Commit bb61ec4

Browse files
committed
Addressing PR review
1 parent 713526b commit bb61ec4

File tree

1 file changed

+8
-4
lines changed
  • spring-kafka-docs/src/main/antora/modules/ROOT/pages

1 file changed

+8
-4
lines changed

spring-kafka-docs/src/main/antora/modules/ROOT/pages/testing.adoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ If this is not possible for some reason, note that the `consumeFromEmbeddedTopic
5656
Since it does not have access to the consumer properties, you must use the overloaded method that takes a `seekToEnd` boolean parameter to seek to the end instead of the beginning.
5757
====
5858

59-
NOTE: The `EmbeddedKafkaRule` JUnit 4 rule has been removed in version 4.0. For JUnit 4, you should use the `EmbeddedKafkaKraftBroker` directly or migrate to JUnit 5 with the `@EmbeddedKafka` annotation.
59+
NOTE: The `EmbeddedKafkaRule` JUnit 4 rule has been removed in version 4.0.
60+
For JUnit 4, you should use the `EmbeddedKafkaKraftBroker` directly or migrate to JUnit 5 with the `@EmbeddedKafka` annotation.
6061

6162
The `EmbeddedKafkaBroker` class has a utility method that lets you consume for all the topics it created.
6263
The following example shows how to use it:
@@ -523,12 +524,15 @@ The following example brings together most of the topics covered in this chapter
523524

524525
[source, java]
525526
----
527+
@EmbeddedKafka(topics = KafkaTemplateTests.TEMPLATE_TOPIC)
526528
public class KafkaTemplateTests {
527529
528-
private static final String TEMPLATE_TOPIC = "templateTopic";
530+
public static final String TEMPLATE_TOPIC = "templateTopic";
529531
530-
@ClassRule
531-
public static EmbeddedKafkaBroker embeddedKafka = new EmbeddedKafkaKraftBroker(1, 1, TEMPLATE_TOPIC);
532+
@BeforeAll
533+
public static void setUp() {
534+
embeddedKafka = EmbeddedKafkaCondition.getBroker();
535+
}
532536
533537
@Test
534538
public void testTemplate() throws Exception {

0 commit comments

Comments
 (0)