fix: migrate all integration tests to JUnit 5 and fix revealed failures#826
Merged
ismisepaul merged 7 commits intodevfrom Mar 31, 2026
Merged
fix: migrate all integration tests to JUnit 5 and fix revealed failures#826ismisepaul merged 7 commits intodevfrom
ismisepaul merged 7 commits intodevfrom
Conversation
37 IT files were using JUnit 4 annotations (org.junit.Test, @before, @BeforeClass, etc.) but the project only has junit-jupiter-engine — no junit-vintage-engine. The JUnit Platform silently skipped them all, reporting 0 tests run with no warning. Migrated all IT files to JUnit 5: updated imports, annotations, and converted @test(expected=...) to assertThrows(). Closes #825
- CountdownHandler.saveCountdowns: fix copy-paste bug where startTime
was saved as lockTime, corrupting DB state
- CountdownHandler: add forceReload() so cached static state can be
invalidated when tests reset the database
- TestProperties.executeSql: call forceReload() after DB reset to
prevent stale CountdownHandler state across test classes
- EnableModuleBlock: fix error message casing ("received" → "Received")
- XxeChallenge1IT: use XxeChallenge1OldWebService (the XML-based
challenge endpoint) instead of XxeLesson (which blocks challenge
file content with its "Wrong File" check)
XxeChallenge1OldWebService was processing requests even when the module was closed, unlike its sibling XxeChallenge1 which properly checks Getter.isModuleOpen(). This caused XxeChallenge1IT testLevelWhenUnsafeLevelsAreDisabled to fail.
ismisepaul
added a commit
that referenced
this pull request
Mar 31, 2026
…es (#826) * fix: migrate all integration tests from JUnit 4 to JUnit 5 (#825) 37 IT files were using JUnit 4 annotations (org.junit.Test, @before, @BeforeClass, etc.) but the project only has junit-jupiter-engine — no junit-vintage-engine. The JUnit Platform silently skipped them all, reporting 0 tests run with no warning. Migrated all IT files to JUnit 5: updated imports, annotations, and converted @test(expected=...) to assertThrows(). Closes #825 * style: apply google-java-format to SetterIT.java * fix: resolve 8 integration test failures revealed by JUnit 5 migration - CountdownHandler.saveCountdowns: fix copy-paste bug where startTime was saved as lockTime, corrupting DB state - CountdownHandler: add forceReload() so cached static state can be invalidated when tests reset the database - TestProperties.executeSql: call forceReload() after DB reset to prevent stale CountdownHandler state across test classes - EnableModuleBlock: fix error message casing ("received" → "Received") - XxeChallenge1IT: use XxeChallenge1OldWebService (the XML-based challenge endpoint) instead of XxeLesson (which blocks challenge file content with its "Wrong File" check) * fix: add missing module-open check to XxeChallenge1OldWebService XxeChallenge1OldWebService was processing requests even when the module was closed, unlike its sibling XxeChallenge1 which properly checks Getter.isModuleOpen(). This caused XxeChallenge1IT testLevelWhenUnsafeLevelsAreDisabled to fail.
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.
Summary
org.junit.Test,@Before,@BeforeClass) to JUnit 5 (org.junit.jupiter.api.*)junit-jupiter-enginebut nojunit-vintage-engine@Test(expected=...)patterns toassertThrows()junit-vintage-enginedependency neededProduction bugs fixed (revealed by newly-running tests)
CountdownHandler.saveCountdowns: copy-paste bug wherestartTimewas saved aslockTime, corrupting DB countdown stateCountdownHandler: addedforceReload()method — the static cache had no invalidation mechanism, causing stale state across test classes whenCountdownHandlerITlefthasEnded=trueEnableModuleBlock: error message casing"received"→"Received"to match expected outputTest fixes
XxeChallenge1IT: was usingXxeLessonservlet instead ofXxeChallenge1OldWebService— the lesson's "Wrong File" check blocks challenge file contentTestProperties.executeSql: callsCountdownHandler.forceReload()after DB reset; migrated stale JUnit 4 importCloses #825
Test plan
mvn compile test-compilepasses (verified locally)