-
Notifications
You must be signed in to change notification settings - Fork 387
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
Use JUnit5 #691
Use JUnit5 #691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. A couple of comments.
build.sbt
Outdated
// -a Show stack traces and exception class name for AssertionErrors. | ||
// -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug". | ||
// -q Suppress stdout for successful tests. | ||
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v", "-q"), | ||
testOptions += Tests.Argument(jupiterTestFramework, "-a", "-v", "-q"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is interesting that with this change these options are still used when running JUnit 4 tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JUnit 4 tests are now run by Jupiter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Then we should be able to get rid of the "com.novocode" % "junit-interface"
dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it turns out, the Junit 4 tests are not run by the Jupiter runner. When junit-interface
is removed they don't run.
testkit/src/main/scala/akka/kafka/testkit/javadsl/KafkaTest.scala
Outdated
Show resolved
Hide resolved
testkit/src/main/scala/akka/kafka/testkit/internal/KafkaTestKit.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I like the refactoring from method overrides to constructor parameters.
I switched to use the Juniper Vintage Engine to run the JUnit 4 tests. |
Benefits
This PR
KafkaTest
andEmbeddedKafkaTest
which rely on JUnit 5 per-class lifecyleProducerExampleTest
andConsumerExampleTest
to use JUnit 5 instead