use of org.springframework.jdbc.support.JdbcTransactionManager in project spring-boot by spring-projects.
the class DataSourceTransactionManagerAutoConfigurationTests method transactionManagerWithCustomizationIsConfigured.
@Test
void transactionManagerWithCustomizationIsConfigured() {
this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)).withPropertyValues("spring.transaction.default-timeout=1m", "spring.transaction.rollback-on-commit-failure=true").run((context) -> {
assertThat(context).hasSingleBean(TransactionManager.class).hasSingleBean(JdbcTransactionManager.class);
JdbcTransactionManager transactionManager = context.getBean(JdbcTransactionManager.class);
assertThat(transactionManager.getDefaultTimeout()).isEqualTo(60);
assertThat(transactionManager.isRollbackOnCommitFailure()).isTrue();
});
}
Aggregations