Skip to content

Integration Tests

How to migrate dbunit data sets?

I often use DBUnit when it comes to integration tests related to the database. DBUnit is a lovely tool to setup a database for integration tests, but it also has a downside: “As more tests you write, more files need to be changed in case of a database schema change“. Wouldn’t it be nice if there would be a tool support, a tool that just scans your project, collects all the data sets it finds and migrates them using your Flyway scripts? Background The best for tests is that you have one data set for one test and maybe even data sets for the database state assertions, but this would… Read More »How to migrate dbunit data sets?

Bugs love logging to hide

A lot of projects run integration and unit tests, but often miss a little something – logging. When you use logging you often check if the log level is enabled or not before you log. But this means that you introduce a control flow statement that enables or disables some code. So if you miss to enable logging for your tests you let code untested and bugs love untested code, because they can hide there. But it is easy to remove this hiding places for bugs. Avoid log level checks if possible If you can avoid log level enabled checks, you avoid control flow statements and this  means that you remove hiding… Read More »Bugs love logging to hide

GDPR Cookie Consent with Real Cookie Banner