Many tests in the current implementation rely on cleaning up (parts of) the db beforehand, for example
|
indexEntryRepository.deleteAll(); |
|
indexSettingsRepository.deleteAll(); |
Cleaning up the db before each test is a valid strategy, see e.g. here, but the current implementation only cleans up specific repositories, instead of resetting the entire db.
As a result, it is easy to forget to clean one up, which may lead to nasty surprises later on, such as #839.
Note that an alternative would be to mark tests with @DataJpaTest or @Transactional, which would roll back any changes after the test. Also see #816
Many tests in the current implementation rely on cleaning up (parts of) the db beforehand, for example
FAIRDataPoint/src/test/java/org/fairdatapoint/acceptance/index/admin/List_Trigger_POST.java
Lines 159 to 160 in f65cd35
Cleaning up the db before each test is a valid strategy, see e.g. here, but the current implementation only cleans up specific repositories, instead of resetting the entire db.
As a result, it is easy to forget to clean one up, which may lead to nasty surprises later on, such as #839.
Note that an alternative would be to mark tests with
@DataJpaTestor@Transactional, which would roll back any changes after the test. Also see #816