I\'m running a simple JUnit test agains an application DAO. The problem is that I always get:
javax.persistence.RollbackException: Transaction marked as roll
I use Junit5, both commit and rollback(false) works with me.
@ExtendWith(SpringExtension.class)
@SpringBootTest
@Transactional
public class MyIntegrationTest {
@Test
@DisplayName("Spring Boot Will Rollback Data, " +
"Can Disable it By Add @Commit Or @Rollback(false) Annotation")
//@Commit
//@Rollback(false)
public void test() throws Exception {
//your test codes here...
}