问题 EDIT: As C. Weber suggested in the comments, the solution is to add @Transactional to the test class. I have some tests that use an H2 in-memory DB. I need to reset the DB before each test. Although my SQL scripts are run each a test is executed, the DB is not properly reset, resulting in a missing needed entry after a delete test. Test class: @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureTestDatabase(replace=Replace.ANY, connection=EmbeddedDatabaseConnection.H2) public class