Which two annotations indicate that the transaction for a transactional test method should be committed after the test method has completed? (Choose two.)
Which two annotations indicate that the transaction for a transactional test method should be committed after the test method has completed? (Choose two.)
The annotations @Rollback(false) and @Commit both indicate that the transaction for a transactional test method should be committed after the test method has completed. @Rollback(false) is used to indicate that a transaction should not be rolled back after the test method has completed, effectively committing it. @Commit is a specific annotation that explicitly commits the transaction after the test method has completed.
correct
The B answer is correct. https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/test/annotation/Rollback.html
@SpringJUnitConfig @Transactional(transactionManager = "txMgr") @Commit class FictitiousTransactionalTest { https://docs.spring.io/spring-framework/reference/testing/testcontext-framework/tx.html#testcontext-tx-annotation-demo
The correct answer is BC