-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate tests to modern JUnit Jupiter
The project currently uses the outdated JUnit 4.13.2. In order to make it easier to write tests and easier for future contributors to easily start working with the project, this patch migrates the test suite to the modern JUnit Jupiter. This patch contains the following changes: - Dependencies: - The junit:junit:4.13.2 dependency was replaced with org.junit.jupiter:junit-jupiter:5.8.1 - Unlike JUnit 4, JUnit Jupiter does not bundle the hamcrest library, so the explicit dependency org.hamcrest:hamcrest:2.2 was added - Annotations - org.junit.jupiter.api.BeforeEach was used as a drop-in replacement for org.junit.Before - org.junit.jupiter.api.Test was used as a drop-in replacement for org.junit.Test without arguments. See "Assertions" below for handling of org.junit.Test with an "expected" argument - Assertions - org.junit.jupiter.api.Assertions was used as a drop-in replacement for org.junit.Assert in the cases the "message" argument was not used. In the cases a "message" argument was used it was moved to be the last argument instead of the first argument - org.hamcrest.MatcherAssert#assertThat was used as a drop-in replacement for org.junit.Assert#assertThat - org.junit.jupiter.api.Assertions#assertThrows was used to assert cases where a method call should throw an exception instead of passing an "expected" argument to the @test annotation. As a side bonus, this also makes the tests stricter, as it asserts the actual method call threw the expected exception and not the code used to set up its arguments/environment. - Misc - Tests using org.junit.rules.TemporaryFolder were rewritten to use the similar org.junit.jupiter.api.io.TempDir. While these two classes conceptually have the same functionality their APIs are different, and this is not a drop-in replacement.
- Loading branch information
Showing
39 changed files
with
486 additions
and
475 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
src/test/java/org/kitteh/irc/client/library/DefaultBuilderTest.java
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.