|
80 | 80 | import org.springframework.context.annotation.Primary;
|
81 | 81 | import org.springframework.core.annotation.Order;
|
82 | 82 | import org.springframework.core.convert.support.ConfigurableConversionService;
|
83 |
| -import org.springframework.integration.transaction.PseudoTransactionManager; |
84 | 83 | import org.springframework.jdbc.BadSqlGrammarException;
|
85 | 84 | import org.springframework.jdbc.core.JdbcTemplate;
|
86 | 85 | import org.springframework.jdbc.datasource.DataSourceTransactionManager;
|
87 | 86 | import org.springframework.jdbc.datasource.init.DatabasePopulator;
|
88 | 87 | import org.springframework.orm.jpa.JpaTransactionManager;
|
89 | 88 | import org.springframework.transaction.PlatformTransactionManager;
|
| 89 | +import org.springframework.transaction.TransactionDefinition; |
| 90 | +import org.springframework.transaction.TransactionException; |
| 91 | +import org.springframework.transaction.support.AbstractPlatformTransactionManager; |
| 92 | +import org.springframework.transaction.support.DefaultTransactionStatus; |
90 | 93 |
|
91 | 94 | import static org.assertj.core.api.Assertions.assertThat;
|
92 | 95 | import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
@@ -544,13 +547,34 @@ public DataSource dataSource() {
|
544 | 547 | @Bean
|
545 | 548 | @Primary
|
546 | 549 | public PlatformTransactionManager normalTransactionManager() {
|
547 |
| - return new PseudoTransactionManager(); |
| 550 | + return new TestTransactionManager(); |
548 | 551 | }
|
549 | 552 |
|
550 | 553 | @BatchTransactionManager
|
551 | 554 | @Bean
|
552 | 555 | public PlatformTransactionManager batchTransactionManager() {
|
553 |
| - return new PseudoTransactionManager(); |
| 556 | + return new TestTransactionManager(); |
| 557 | + } |
| 558 | + |
| 559 | + } |
| 560 | + |
| 561 | + static class TestTransactionManager extends AbstractPlatformTransactionManager { |
| 562 | + |
| 563 | + @Override |
| 564 | + protected Object doGetTransaction() throws TransactionException { |
| 565 | + return null; |
| 566 | + } |
| 567 | + |
| 568 | + @Override |
| 569 | + protected void doBegin(Object transaction, TransactionDefinition definition) throws TransactionException { |
| 570 | + } |
| 571 | + |
| 572 | + @Override |
| 573 | + protected void doCommit(DefaultTransactionStatus status) throws TransactionException { |
| 574 | + } |
| 575 | + |
| 576 | + @Override |
| 577 | + protected void doRollback(DefaultTransactionStatus status) throws TransactionException { |
554 | 578 | }
|
555 | 579 |
|
556 | 580 | }
|
|
0 commit comments