Repository navigation
Migrate tests to JUnit Jupiter - #374
Closed
strangelookingnerd wants to merge 3 commits into
Closed
strangelookingnerd wants to merge 3 commits into
strangelookingnerd wants to merge 3 commits into
Conversation
* Migrate annotations and imports * Migrate assertions * Remove public visibility for test classes and methods * Minor code cleanup
* Migrate annotations and imports * Migrate assertions * Remove public visibility for test classes and methods * Minor code cleanup
Member
Member
|
Thank you again for this. |
jmanico
added a commit
that referenced
this pull request
Sep 8, 2026
Reviewing #374 against #415 turned up cleanups the contributor made that the fresh migration lacked: String.join in place of stream/collect joins, assertArrayEquals for the code unit comparison, lambdas for the preprocessor wrappers and the benchmark's error handlers, an enhanced for loop with StandardCharsets over the AntiSamy base64 inputs, StringBuilder for StringBuffer, and redundant `final` dropped from private static methods. Co-authored-by: strangelookingnerd <49242855+strangelookingnerd@users.noreply.github.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZfawfTUAFHN7cocUjcpQK
daham-13
pushed a commit
to daham-13/java-html-sanitizer
that referenced
this pull request
Sep 16, 2026
The tests were JUnit 3 `TestCase` subclasses run through the JUnit 4 provider, with `public static final void test*()` methods that only the JUnit 3 reflection runner would find. They now run on JUnit Jupiter 5.14 (the last line that still supports the Java 8 target) via the JUnit BOM. * Every `test*` method carries `@Test` and is package-private and non-static; JUnit 3/4 message-first assertions are reordered to the Jupiter `(expected, actual, message)` form. * `setUp`/`tearDown` overrides become named `@BeforeEach`/`@AfterEach` methods; the AntiSamy `suite()` and the JUnit 3 `VerboseTestRunner` are gone. * Expected exceptions use `assertThrows`; the example programs run as a `@ParameterizedTest`, one case per example, and the diagnostic output of a failing example now reaches the real stderr. * The nested-anchor tag balancing test that was hidden behind a `failingtest` name prefix is `@Disabled` with a reason, so it shows up as skipped instead of vanishing. * Single-method anonymous `Handler`, `AttributePolicy`, `ElementPolicy`, `Function` and `Runnable` classes are lambdas; stray tab indentation in four test files is normalized. * `java8-shim` and `java10-shim` have no tests and drop their JUnit dependency. Per-class test counts are unchanged from main (378), plus the two extra example cases and the newly visible skipped test. `./mvnw verify` passes on JDK 11, 17, 21 and 25, and `-Djunit.seed=<seed>` still replays the fuzzers. Supersedes OWASP#374. Co-authored-by: strangelookingnerd <49242855+strangelookingnerd@users.noreply.github.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZfawfTUAFHN7cocUjcpQK
|
🎉 This issue has been resolved in |
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.
This PR aims to migrate all tests to JUnit Jupiter. Changes include:
I am well aware that this is a quite large changeset however I hope that there is still interest in this PR and it will be reviewed.
If there are any questions, please do not hesitate to ping me.