Update exception tests to JUnit Jupiter#368
Merged
asfgit merged 1 commit intoapache:masterfrom Oct 7, 2018
Merged
Conversation
Upgrade the tests in the exception package to use JUnit Jupiter as part of the effort to remove the dependency on the Vintage Engine. While most of these changes are drop-in replacements with no functional benefit, there are some non-obvious changes worth mentioning. Unlike org.junit.Test, org.junit.jupiter.api.Test does not have an "expected" argument. Instead, an explicit call to org.junit.jupiter.api.Assertions.assertThrows is used. Another non-obvious change was performed in ContextedRuntimeExceptionTest. Unlike JUnit Vintages's @before, JUnit Jupiter's @beforeeach does not apply if a parent's method is annotated with it and the overriding method is not, so an explicit @beforeeach annotation had to be added to ContexedTuntimeExceptionTest#setUp(). It's also worth noting this is a minimal patch for migrating the package's tests to Jupiter. There are several tests that can be made made more elegant with Jupiter's new features, but that work is left for subsequent patches.
Contributor
|
Thanks! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrade the tests in the
exceptionpackage to use JUnit Jupiter as part of the effort to remove the dependency on the Vintage Engine.While most of these changes are drop-in replacements with no functional benefit, there are some non-obvious changes worth mentioning.
Unlike
org.junit.Test,org.junit.jupiter.api.Testdoes not have anexpectedargument. Instead, an explicit call toorg.junit.jupiter.api.Assertions.assertThrowsis used.Another non-obvious change was performed in
ContextedRuntimeExceptionTest. Unlike JUnit Vintage's@Before, JUnit Jupiter's@BeforeEachdoes not apply if a parent's method is annotated with it and the overriding method is not, so an explicit@BeforeEachannotation had to be added toContexedTuntimeExceptionTest#setUp().It's also worth noting this is a minimal patch for migrating the package's tests to Jupiter. There are several tests that can be made more elegant with Jupiter's new features, but that work is left for subsequent patches.