Add beforeeach module: @BeforeEach/@AfterEach lifecycle demos on JUnit 6.1.3 (JDK 25)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b6FRR2Dk1163xJ5CdV
This commit is contained in:
2026-11-15 01:14:28 +05:30
co-authored by Claude Sonnet 5.5
parent bfc67986bc
commit e49be6d633
36 changed files with 690 additions and 0 deletions
@@ -0,0 +1,14 @@
== StaticBeforeEach
-- results --
FAILED <engine> DiscoveryIssueException: TestEngine with ID 'junit-jupiter' encountered a critical issue during test discovery:
(1) [ERROR] @BeforeEach method 'static void com.ankurm.tutorials.junit.beforeeach.Fixtures$StaticBeforeEach.setUp()' must not be static.
Source: MethodSource [className = 'com.ankurm.tutorials.junit.beforeeach.Fixtures$StaticBeforeEach', methodName = 'setUp', methodParameterTypes = '']
at com.ankurm.tutorials.junit.beforeeach.Fixtures$StaticBeforeEach.setUp(SourceFile:0)
== NonVoidBeforeEach
-- results --
FAILED <engine> DiscoveryIssueException: TestEngine with ID 'junit-jupiter' encountered a critical issue during test discovery:
(1) [ERROR] @BeforeEach method 'java.lang.String com.ankurm.tutorials.junit.beforeeach.Fixtures$NonVoidBeforeEach.setUp()' must not return a value.
Source: MethodSource [className = 'com.ankurm.tutorials.junit.beforeeach.Fixtures$NonVoidBeforeEach', methodName = 'setUp', methodParameterTypes = '']
at com.ankurm.tutorials.junit.beforeeach.Fixtures$NonVoidBeforeEach.setUp(SourceFile:0)