???????????????????TestExecutionListeners?????TestContextManager??????? ?????@TestExecutionListeners??@ContextConfiguration???????á?

@ContextConfiguration
@TestExecutionListeners({CustomTestExecutionListener.class?? AnotherTestExecutionListener.class})
public class CustomTestExecutionListenerTests {
// class body...
}

????@TransactionConfiguration
???????????????????????????????????????????????PlatformTransactionManager????“transactionManager”????? ???????????????????????PlatformTransactionManager??bean????????? ?????defaultRollback??????false??????? @TransactionConfiguration??@ContextConfiguration??????á?

@ContextConfiguration
@TransactionConfiguration(transactionManager="txMgr"?? defaultRollback=false)
public class CustomConfiguredTransactionalTests {
// class body...
}
@BeforeTransaction
??????????public void??????????????????????????У? ???????????@Transactional???????????
@BeforeTransaction
public void beforeTransaction() {
// logic to be executed before a transaction is started
}
@AfterTransaction
??????????public void?????????????????????????????У? ???????????@Transactional???????????
@AfterTransaction
public void afterTransaction() {
// logic to be executed after a transaction has ended
}