|
31 | 31 | import org.springframework.boot.test.context.TestConfiguration; |
32 | 32 | import org.springframework.context.ApplicationContext; |
33 | 33 | import org.springframework.context.annotation.Bean; |
34 | | -import org.springframework.data.neo4j.core.DatabaseSelectionProvider; |
| 34 | +import org.springframework.data.neo4j.core.ReactiveDatabaseSelectionProvider; |
35 | 35 | import org.springframework.data.neo4j.core.ReactiveNeo4jTemplate; |
36 | | -import org.springframework.data.neo4j.core.transaction.Neo4jTransactionManager; |
37 | | -import org.springframework.data.neo4j.repository.config.ReactiveNeo4jRepositoryConfigurationExtension; |
| 36 | +import org.springframework.data.neo4j.core.transaction.ReactiveNeo4jTransactionManager; |
38 | 37 | import org.springframework.test.context.DynamicPropertyRegistry; |
39 | 38 | import org.springframework.test.context.DynamicPropertySource; |
| 39 | +import org.springframework.transaction.annotation.Propagation; |
| 40 | +import org.springframework.transaction.annotation.Transactional; |
40 | 41 |
|
41 | 42 | import static org.assertj.core.api.Assertions.assertThatExceptionOfType; |
42 | 43 |
|
43 | 44 | /** |
44 | | - * Integration tests for the reactive SDN/RX Neo4j test slice. |
| 45 | + * Integration tests for {@link DataNeo4jTest @DataNeo4jTest} with reactive style. |
45 | 46 | * |
46 | 47 | * @author Michael J. Simons |
47 | 48 | * @author Scott Frederick |
48 | 49 | * @since 2.4.0 |
49 | 50 | */ |
50 | 51 | @DataNeo4jTest |
| 52 | +@Transactional(propagation = Propagation.NOT_SUPPORTED) |
51 | 53 | @Testcontainers(disabledWithoutDocker = true) |
52 | 54 | class DataNeo4jTestReactiveIntegrationTests { |
53 | 55 |
|
@@ -82,18 +84,13 @@ void didNotInjectExampleService() { |
82 | 84 | .isThrownBy(() -> this.applicationContext.getBean(ExampleService.class)); |
83 | 85 | } |
84 | 86 |
|
85 | | - // Providing this bean fulfills a requirement that a @Transactional test has a |
86 | | - // PlatformTransactionManager in the app context (enforced by |
87 | | - // org.springframework.test.context.transaction.TransactionalTestExecutionListener). |
88 | | - // Providing a ReactiveNeo4jTransactionManager would be more appropriate, but won't |
89 | | - // allow the test to succeed. |
90 | 87 | @TestConfiguration(proxyBeanMethods = false) |
91 | 88 | static class ReactiveTransactionManagerConfiguration { |
92 | 89 |
|
93 | | - @Bean(ReactiveNeo4jRepositoryConfigurationExtension.DEFAULT_TRANSACTION_MANAGER_BEAN_NAME) |
94 | | - Neo4jTransactionManager reactiveTransactionManager(Driver driver, |
95 | | - DatabaseSelectionProvider databaseNameProvider) { |
96 | | - return new Neo4jTransactionManager(driver, databaseNameProvider); |
| 90 | + @Bean |
| 91 | + ReactiveNeo4jTransactionManager reactiveTransactionManager(Driver driver, |
| 92 | + ReactiveDatabaseSelectionProvider databaseNameProvider) { |
| 93 | + return new ReactiveNeo4jTransactionManager(driver, databaseNameProvider); |
97 | 94 | } |
98 | 95 |
|
99 | 96 | } |
|
0 commit comments