Skip to main content

Java

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.

Writing Your First Clean Test in JUnit 6 (Best Practices)

A practical guide to writing clean, readable, and maintainable JUnit 6 tests. Covers the Arrange-Act-Assert pattern, one behaviour per test, @DisplayName, assertAll, avoiding logic in tests, and six habits that separate good tests from great ones.

JUnit 6 Architecture Deep Dive: Platform, Engines, and Launchers

A deep dive into JUnit 6's three-pillar architecture: Platform, Jupiter, and Vintage. Learn how the TestEngine SPI, Launcher, and LauncherDiscoveryRequest work together, with code examples showing programmatic test execution and custom engine concepts.

JUnit 6 vs JUnit 5: Key Differences, Features, and Migration Guide

A detailed, side-by-side comparison of JUnit 6 and JUnit 5 — architecture, annotations, parameterized tests, extension model, and records support — plus a practical migration guide updated for Spring Boot 4.0, which makes JUnit 6 the default testing baseline.

JUnit 6 Project Structure and Best Practices

Learn how to structure your JUnit 6 test projects for scalability and long-term maintainability. Covers package layout, naming conventions, test base classes, test helpers, and real-world best practices used in production Java projects.

JUnit 6 with Maven and Gradle: Complete Setup Guide

A comprehensive guide to configuring JUnit 6 with Maven and Gradle. Covers Surefire plugin, Failsafe plugin, multi-module projects, test filtering, IDE integration, and common configuration mistakes to avoid.

Hibernate 7 get() vs getReference(): Four Calls, Four Outcomes

session.get() and session.getReference() look interchangeable at a glance, but the difference isn't "eager vs lazy" -- it's what you're telling Hibernate you need. This piece runs four calls against Hibernate 7.4.1.Final, builds the full same-session matrix, and pins down exactly where the proxy identity contract breaks -- including one same-session result that the usual L1-cache explanation gets wrong.

Hibernate 7 merge() vs refresh(): Which One Fails Loudly?

merge() and refresh() get described as opposite directions of the same tool -- one pushes, one pulls. Run them against a real @Version-ed entity and that framing misses the actual question: which one fails loudly when the state it's holding is stale? Three named experiments against Hibernate 7.4.1.Final, including a result that overturned the article's own original assumption.

Hibernate 7 Batch Inserts: How to Prove Batching Is Working

Setting hibernate.jdbc.batch_size is not the same as verifying batching happens. Two nearly identical entities, one GenerationType difference, and Hibernate's own statistics show a 30-vs-4 prepared-statement gap -- then two sweeps (allocationSize, batch_size) run the numbers instead of predicting them, including one off-by-one that reproduced across two separate full-suite runs.