
JUnit TempDir for Temporary Files and Test Resources
Create and clean up temporary files in JUnit with TempDir, share a directory per class, load files from test resources and avoid fragile paths in tests.
Everything you need to level up your coding skills.

Create and clean up temporary files in JUnit with TempDir, share a directory per class, load files from test resources and avoid fragile paths in tests.

Test Vaadin Flow views at two levels: fast unit tests that drive components without a browser, and end to end browser tests with TestBench or Playwright.

Use Testcontainers at development time in Spring Boot: ServiceConnection, a test entry point, reusing containers and sharing definitions with tests.

Fix Mockito's UnnecessaryStubbingException by removing dead stubs, moving setup into the tests that use it and using lenient stubs only where they belong.

Test a Java microservice in isolation: unit and slice tests, Testcontainers for its own database, WireMock for dependencies and contract tests.

Test a Play application with JUnit, from plain controller unit tests to full-application tests that route fake HTTP requests and use an embedded server.

Reproduce lost updates and check then act races in Java, learn the patterns that signal a race, fix them with atomics and locks and test for them under load.

Use Mockito spy to stub part of a real object, learn the doReturn syntax, and see why a spy often signals a class that should be split instead.

Set up Mockito with JUnit 5 using MockitoExtension, Mock, InjectMocks and Captor, choose strictness, and avoid manual MockitoAnnotations.openMocks calls.

Learn AssertJ: fluent assertions for values, strings, collections, exceptions and objects, soft assertions, custom messages and extracting fields.

Move from coarse roles to fine permissions in Spring Security with method security, custom bean checks, a meta annotation and tests for allow and deny.

Test concurrent Java code and find race conditions: stress tests with many threads, latches, repeated runs, jcstress and thread-safety design.
We send one email when a new post is published. No spam.