I've tried to use @DirtiesContext but it doesn't work. I want to make every class with integration tests isolated.
I've tried to use @DirtiesContext but it doesn't work. I want to make every class with integration tests isolated.
You can use @DataJpaTest because @DataJpaTest are transactional and roll back at the end of each test or just write clean script if you need full context by using @SpringBootTest
@SpringBootTest
@Sql(scripts = "classpath:clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD,
config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED))