Skip to content

Update testing docs for 4.0.0 with the updates in EmbeddedKafka #3822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 25, 2025

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