Skip to main content

JUnit 6 Internals: How the Test Engine Works

An in-depth look at JUnit 6 internals: the two-phase discovery and execution model, the TestDescriptor tree, the EngineExecutionListener event chain, UniqueId addressing, and programmatic test plan inspection with complete runnable code examples.

Parallel Test Execution in JUnit 6: Configuration and Pitfalls

A complete guide to JUnit 6 parallel test execution: enabling and configuring parallelism, class vs method level concurrency, @Execution and @ResourceLock annotations, thread pool strategies, pitfall table with fixes, and real performance benchmarks.

JUnit 6 Extensions Model: Build Custom Extensions Step-by-Step

A step-by-step guide to building JUnit 6 extensions. Covers all extension interfaces: lifecycle callbacks, ParameterResolver, TestExecutionExceptionHandler, @RegisterExtension with configuration, the ExtensionContext.Store, and a complete interface reference table.

Tags and Test Suites in JUnit 6: Organizing Large Test Bases

A complete guide to using @Tag in JUnit 6 to categorize tests, build test suites, filter by tag at build time using Maven and Gradle, and apply tagging strategies for fast vs slow, unit vs integration, and feature-flag-based test selection.

Structuring Tests with JUnit 6 Nested Tests (Real-World Use Cases)

Learn how to use @Nested in JUnit 6 to organise tests into scenario-based inner class groups. Covers lifecycle composition, real-world patterns for REST controllers and domain services, nesting rules, and a complete ShoppingCart example with full test report output.

JUnit 6 Assumptions and Conditional Test Execution Guide

Learn how JUnit 6 Assumptions differ from Assertions, and how to use assumeTrue, assumeFalse, assumingThat, and conditional annotations like @EnabledOnOs, @EnabledOnJre, and @EnabledIfEnvironmentVariable to skip tests gracefully when preconditions are not met.

JUnit 6 Assertions: All Methods Explained with Real Examples

A complete reference guide to every JUnit 6 assertion method: assertEquals, assertThrows, assertAll, assertTimeout, assertIterableEquals, and more — each explained with real code examples, expected output, and when to use which.