Testing Databases with JUnit and Hibernate Part 3: Cleaning up and Further Ideas

This is the last part in this little series about testing of database code. In the first part I extracted the session handling for the tests into a JUnit Rule. In the second part I introduced ObjectMothers for easy creation of instances in the database. In this part I’ll simplify the implementation of new ObjectMothers [...]

Testing Databases with JUnit and Hibernate Part 2: The Mother of All Things

In the first part of this little series I showed a simple test based on a simple data model. As we saw the code for the test wasn’t simple at all, but quite ugly. We started to fix that by moving out all the SessionFactory and Session handling stuff out into a Rule. Leaving us [...]

Testing Databases with JUnit and Hibernate Part 1: One to Rule them

Databases are an extremely important part of almost every enterprise application. Yet there is very little support for testing your database, which results in very little tests coverage of database related code out in the wild. In a desperate attempt to change that at least a little the article series starting with this article will [...]