Skip to main content

Testing

Testing — unit testing, integration testing, and test automation in Java

Load Testing Spring Boot with Gatling’s Java DSL (and How It Compares to k6)

A tiny Spring Boot 4.1.2 app with a deliberate 160-requests-per-second limit, load tested with Gatling 3.16.0's Java DSL: scenarios, feeders and checks, open versus closed injection (and why a closed model hides the overload), an incrementUsersPerSec staircase that finds the knee between 150 and 180 users per second, global assertions that fail the Maven build, and what the Gatling report does and does not contain. The same test is then run in k6 v2.3.0 on the same app and compared.

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.

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.

10 AI Prompts to Debug and Fix JUnit 6 Test Failures

10 AI prompts for debugging and fixing broken, flaky, and incorrectly behaving JUnit 6 tests. Each prompt is structured to provide complete failure context — stack traces, test code, production code — and diagnose root causes across assertion errors, NPEs, Mockito issues, Spring context failures, Testcontainers problems, and more.

10 AI Prompts to Optimise and Update Existing JUnit 6 Tests

10 AI prompts to optimise, update, and improve existing JUnit 6 test classes. Covers refactoring for readability, JUnit 4 migration, removing unnecessary Spring contexts, fixing brittle mocks, adding boundary tests, consolidating duplicates, restructuring with @Nested, and full quality audits.

10 AI Prompts to Generate JUnit 6 Tests for New Projects

10 ready-to-use AI prompts to generate high-quality JUnit 6 test cases for new Java projects. Each prompt is engineered for GitHub Copilot, Claude, ChatGPT, or any LLM to produce complete, annotated, production-ready tests covering unit, integration, parameterized, and exception scenarios.