Skip to main content

JUnit

Instancio: Generate Realistic Test Data Automatically in Java

Instancio 6.1 fills whole Java object graphs with random data and replays any failure from a seed. Run on JUnit 6.1.3: selectors, Settings, records and sealed types, TypeToken, the extension, and the real seed message from a failing test.

Top 30 JUnit 6 and Mockito Interview Questions (2026)

30 JUnit 6 and Mockito 5 interview questions answered with tests that were actually run on JUnit 6.1.3, Mockito 5.24.0 and JDK 25: lifecycle, extensions, parameterized tests, mocks vs spies, verify, static mocking and flaky tests, each with captured output.

AssertJ Complete Guide: Soft Assertions, Recursive Comparison and Custom Assertions

A beginner-first AssertJ 3.27.7 guide with real failure messages: fluent assertions, collections, exceptions, soft assertions and their traps, recursive comparison for DTOs, and custom assertions both hand-written and generated (including the javax.annotation fix the 2019 generator plugin needs on JDK 25). Every output is captured from a runnable companion module.

Migrating to Testcontainers 2.0: Artifact Renames, Package Moves and JUnit 6

Testcontainers 2.0 bundles three independent changes under one version number: 61 artifacts renamed with a testcontainers- prefix, JUnit 4 support physically removed from the GenericContainer type hierarchy (not deprecated — verified by jar inspection, zero classes implement TestRule), and the default Docker API version bumped from 1.32 to 1.44, which is what actually fixes the real Docker Engine 29 compatibility break reported in testcontainers-java#11235. Includes a self-caught mistake: @EnabledIfDockerAvailable only works on the class, not the method, because TestcontainersExtension starts @Container fields in beforeAll before any method-level condition runs.

JUnit 6

Complete guide to JUnit 6 with links to all articles covering getting started, core patterns, advanced techniques, mocking, extensions, integration testing, and best practices.

Modern Java Testing: JUnit 6 + AssertJ + Mockito 5 + Testcontainers

A practical guide to the modern Java test stack — JUnit 6 as the runner, AssertJ for fluent assertions, Mockito 5 for mocking, and Testcontainers for real infrastructure. Includes runnable examples for each and AI prompts to generate and refactor tests.

JUnit 6 Nullability: @Nullable, @NonNull and @NullMarked Explained

A practical guide to JUnit 6 nullability annotations via JSpecify: @Nullable, @NonNull, and @NullMarked. Covers what each annotation means, how they improve compile-time null safety, IDE and static analysis integration, Kotlin interop, and complete Java code examples for each annotation.