public class AbstractContainerBaseTest {
@ServiceConnection
static final MySQLContainer<?> MY_SQL_CONTAINER = new MySQLContainer<>("mysql:8.0.32")
static {
MY_SQL_CONTAINER.start();
}
}
class FirstTest extends AbstractContainerBaseTest {
@Test
void someTestMethod() {
}
}
I have a AbstractContainerBaseTest and other test classes will extend it. I encounter problem when running all test classes some test methods will fail but when I only run the test classes individually containing of said methods they will pass. As far as I understand all test classes share a same container so my question is how to reset DB after each test class?