Skip to content

fix(test): add missing JUnit 5 annotations so dormant tests run#12

Merged
marevol merged 1 commit into
masterfrom
fix/junit5-test-annotations
Jun 25, 2026
Merged

fix(test): add missing JUnit 5 annotations so dormant tests run#12
marevol merged 1 commit into
masterfrom
fix/junit5-test-annotations

Conversation

@marevol

@marevol marevol commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

CustomSystemHelperTest extends UnitWebappTestCase, which derives from utflute's LastaFluteTestCase. utflute has migrated to JUnit 5 (Jupiter), under which Surefire only runs methods carrying @Test. The test_* methods in this class had no @Test annotation, so the whole class was silently skipped (0 tests executed) despite compiling and having valid assertions.

Changes

  • Add @Test to each no-argument test_* test method (23 methods) and import org.junit.jupiter.api.Test.

Note on setUp / tearDown

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 causes them to run twice; the duplicate teardown then dereferences an already-reverted bound-component result and throws a NullPointerException. Leaving them unannotated matches the existing pattern in UnitWebappTestCase.

Verification

mvn formatter:format license:format && mvn test

Tests run: 23, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Before the fix the class contributed 0 executed tests.

Co-Authored-By: Claude noreply@anthropic.com

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>
@marevol marevol merged commit 20db00b into master Jun 25, 2026
3 checks passed
@marevol marevol deleted the fix/junit5-test-annotations branch June 25, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant