@@ -78,21 +78,13 @@ The test slice provides all the necessary infrastructure for tests using Neo4j:
78
78
depending on reactive dependencies present or not.
79
79
The test slice already includes `@ExtendWith(SpringExtension.class)` so that it runs automatically with JUnit 5 (JUnit Jupiter).
80
80
81
- `@DataNeo4jTest` provides both imperative and reactive infrastructure by default.
82
- It does *not* make your test `@Transactional` however.
83
-
84
- `@Transactional` in Spring tests however always means imperative transactional,
85
- as declarative transactions needs the return type of a method to decide whether the imperative `PlatformTransactionManager`
86
- or the reactive `ReactiveTransactionManager` is needed. Testmethods however don't return anything and neither the
87
- Spring Framework itself, the testing framework or Spring Data Neo4j can decide this in a reliable way for the user.
88
-
89
- IMPORTANT: Make sure to add `@Transactional` to your test class in case you want to test imperative transactions
90
- that should be automatically rolled back after the test.
91
- To assert the correct transactional behaviour for reactive repositories or services, you will need to
92
- inject a `TransactionalOperator` into the test or wrap your domain logic in services that use annotated
93
- methods exposing a return type that makes it possible for the infrastructure to select the correct
94
- transaction manager.
81
+ `@DataNeo4jTest` provides both imperative and reactive infrastructure by default and also adds an implicit `@Transactional` as well.
82
+ `@Transactional` in Spring tests however always means imperative transactional, as declarative transactions needs the
83
+ return type of a method to decide whether the imperative `PlatformTransactionManager` or the reactive `ReactiveTransactionManager` is needed.
95
84
85
+ To assert the correct transactional behaviour for reactive repositories or services, you will need to inject a `TransactionalOperator`
86
+ into the test or wrap your domain logic in services that use annotated methods exposing a return type that makes it possible
87
+ for the infrastructure to select the correct transaction manager.
96
88
97
89
The test slice does not bring in an embedded database or any other connection setting.
98
90
It is up to you to use an appropriate connection.
0 commit comments