dbUnit is a JUnit extension (also usable from Ant and Maven) targeted for database-driven projects that, among other things, puts your database into a known state between test runs. This is an excellent way to avoid the myriad of problems that can occur when one test case corrupts the database and causes subsequent tests to fail or exacerbate the damage.
Pragmatic Unit Testing in Java with JUnitPragmatic Unit Testing in Java with JUnit (2024)
by Langr, Jeff
Learning Test-Driven Development: A Polyglot Guide to Writing Uncluttered CodeLearning Test-Driven Development: A Polyglot Guide to Writing Uncluttered Code (2021)
by Siddiqui, Saleem
Test-Driven Development with Java: Create higher-quality software by writing tests first with SOLID and hexagonal architectureTest-Driven Development with Java: Create higher-quality software by writing tests first with SOLID and hexagonal architecture (2023)
by Mellor, Alan
Test-Driven Java Development - Second Edition: Invoke TDD principles for end-to-end application developmentTest-Driven Java Development - Second Edition: Invoke TDD principles for end-to-end application development (2018)
by Alex Garcia;Viktor Farcic
Java For Testers: Learn Java fundamentals fastJava For Testers: Learn Java fundamentals fast (2015)
by Richardson, Mr Alan J
Test Driven: TDD and Acceptance TDD for Java DevelopersTest Driven: TDD and Acceptance TDD for Java Developers (2007)
by Koskela, Lasse