Skip to main content

Testing

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

Testing Hibernate 7 with Mocked JNDI DataSources

A working simple-jndi 0.25.0 setup for Hibernate 7 tests, correcting two stale dependency coordinates that break the standard tutorial outright. Covers the shared-context gotcha behind confusing empty-context failures, the real fix for cross-test "Name already bound" pollution, Boot 4.1.1's relocated spring.datasource.jndi-name, and an honest report of what could not be made to work.

Hibernate 7 In-Memory Databases: H2, HSQLDB and Derby for Testing

A working H2 setup for Hibernate 7 unit tests, then a real side-by-side comparison against HSQLDB and Apache Derby: the Derby dialect class that no longer exists in hibernate-core, the H2 MODE= myth settled with identical DDL, a reserved-word column that fails only on H2, and a second-level-cache trap that silently changes what your test suite is actually testing.