Skip to content

Add Database Migration Tests

Jose V. Trigueros requested to merge add-migration-tests into master

When running the limited tests for PawaTest, part of the initialization required the setup of an EmbeddedDatabase instance. During the init phase of the EmbeddedDatabase, the migrations run, which leads to the side effect of testing the H2 migrations.

I figured that should be a separate test, but as it was, the two classes implementing Database were not very testable. Hence this merge request.

In this merge request, we're adding migration tests for both H2 and Postgres. This requires that we change the way the databases are initialized as well as adding the testcontainers dependency to make testing the migrations simpler.

Overall, this is a good quality of life change. Not sure why I didn't do this before 😅

Merge request reports