Search in sources :

Example 1 with AfterTransaction

use of org.springframework.test.context.transaction.AfterTransaction in project spring-framework by spring-projects.

the class LookUpTxMgrViaTransactionManagementConfigurerWithSingleTxMgrBeanTests method afterTransaction.

@AfterTransaction
void afterTransaction() {
    assertThat(txManager.begun).isEqualTo(0);
    assertThat(txManager.inflight).isEqualTo(0);
    assertThat(txManager.commits).isEqualTo(0);
    assertThat(txManager.rollbacks).isEqualTo(0);
    CallCountingTransactionManager annotationDriven = config.annotationDriven;
    assertThat(annotationDriven.begun).isEqualTo(1);
    assertThat(annotationDriven.inflight).isEqualTo(0);
    assertThat(annotationDriven.commits).isEqualTo(0);
    assertThat(annotationDriven.rollbacks).isEqualTo(1);
}
Also used : CallCountingTransactionManager(org.springframework.transaction.testfixture.CallCountingTransactionManager) AfterTransaction(org.springframework.test.context.transaction.AfterTransaction)

Aggregations

AfterTransaction (org.springframework.test.context.transaction.AfterTransaction)1 CallCountingTransactionManager (org.springframework.transaction.testfixture.CallCountingTransactionManager)1