fix(test): add missing JUnit 5 annotations so dormant tests run#12
Merged
Conversation
CustomSystemHelperTest extends UnitWebappTestCase, which derives from utflute's LastaFluteTestCase. utflute has migrated to JUnit 5 (Jupiter), where Surefire only executes methods carrying @test. The test_* methods in this class had no @test annotation, so the entire class was silently skipped (0 tests executed) even though it compiled and the assertions were valid. Add @test to each no-argument test_* method (23 methods) and import org.junit.jupiter.api.Test. The overridden setUp(TestInfo)/tearDown(TestInfo) hooks are intentionally left WITHOUT @BeforeEach/@AfterEach: utflute's PlainTestCase already declares @beforeeach frameworkEntrySetUp / @AfterEach frameworkEntryTearDown, which invoke these overridable hooks. Annotating the overrides directly would invoke them twice, and the duplicate teardown dereferences an already-reverted bound-component result (NullPointerException). This matches the existing pattern in UnitWebappTestCase. With the fix, the suite reports 23 tests run, 0 failures, 0 errors. Co-Authored-By: Claude <noreply@anthropic.com>
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
CustomSystemHelperTestextendsUnitWebappTestCase, which derives from utflute'sLastaFluteTestCase. utflute has migrated to JUnit 5 (Jupiter), under which Surefire only runs methods carrying@Test. Thetest_*methods in this class had no@Testannotation, so the whole class was silently skipped (0 tests executed) despite compiling and having valid assertions.Changes
@Testto each no-argumenttest_*test method (23 methods) and importorg.junit.jupiter.api.Test.Note on setUp / tearDown
The overridden
setUp(TestInfo)/tearDown(TestInfo)hooks are intentionally left without@BeforeEach/@AfterEach. utflute'sPlainTestCasealready declares@BeforeEach frameworkEntrySetUp/@AfterEach frameworkEntryTearDown, which invoke these overridable hooks. Annotating the overrides directly causes them to run twice; the duplicate teardown then dereferences an already-reverted bound-component result and throws aNullPointerException. Leaving them unannotated matches the existing pattern inUnitWebappTestCase.Verification
mvn formatter:format license:format && mvn testBefore the fix the class contributed 0 executed tests.
Co-Authored-By: Claude noreply@anthropic.com