Skip to content

Conversation

sobychacko
Copy link
Contributor

No description provided.

@artembilan artembilan added this to the 4.0.0-M2 milestone Mar 25, 2025
----

NOTE: The `EmbeddedKafkaKraftBroker` is not supported with JUnit4.
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One sentence per line: https://asciidoctor.org/docs/asciidoc-recommended-practices/

Suggested change
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.
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.

@@ -555,12 +528,12 @@ public class KafkaTemplateTests {
private static final String TEMPLATE_TOPIC = "templateTopic";

@ClassRule
public static EmbeddedKafkaRule embeddedKafka = new EmbeddedKafkaRule(1, true, TEMPLATE_TOPIC);
public static EmbeddedKafkaBroker embeddedKafka = new EmbeddedKafkaKraftBroker(1, 1, TEMPLATE_TOPIC);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that this is going to work since EmbeddedKafkaBroker is not a JUnit 4 Rule.
Pay attention to that @ClassRule on this property.

Perhaps @BeforeClass can be used instead?

@artembilan artembilan merged commit 35542b0 into spring-projects:main Mar 25, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants