spring boot 2.5.8 版本 使用 test类,其事务默认是回滚的。 ---刚好是发现,有些测试发现正确执行了,但是又回滚了。 加入事务和回滚注解。
@SpringBootTest
@Transactional(rollbackFor = Exception.class)
@Rollback(value = false)
class StudentReposityTest {
}
spring boot 2.5.8 版本 使用 test类,其事务默认是回滚的。 ---刚好是发现,有些测试发现正确执行了,但是又回滚了。 加入事务和回滚注解。
@SpringBootTest
@Transactional(rollbackFor = Exception.class)
@Rollback(value = false)
class StudentReposityTest {
}