Skip to main content

JUnit

JUnit @RepeatedTest in JUnit 6: RepetitionInfo, failureThreshold, and Real Flaky-Test Detection

JUnit's @RepeatedTest runs the same method N times, each with its own pass/fail result. Rebuilt here against real JUnit 6.1.3 on JDK 25: all four RepetitionInfo accessors (not just two), RepetitionInfo injected into @BeforeEach/@AfterEach, what failureThreshold actually does when it fires (skips, not stops), a real flaky-test detection demo, and a placeholder the original version of this post claimed existed but never did.

Understanding JUnit 5 @AfterEach Annotation with Practical Examples

This post has been merged into a single, updated guide covering both @BeforeEach and @AfterEach together, with a per-method lifecycle diagram and a JUnit 6 compatibility note: JUnit @BeforeEach and @AfterEach: The Complete Test Lifecycle Guide. Everything that was here…

JUnit @BeforeAll and @AfterAll: One-Time Setup and Teardown

How JUnit @BeforeAll and @AfterAll work on JUnit 6 and 5: why they are static, how @TestInstance(PER_CLASS) lifts that, what happens when setup throws, and how @TempDir and the extension Store clean up shared resources for you. Every claim is backed by a run in a companion repository.