Skip to content

Commit 5deedaa

Browse files
committed
GH-2157 - Add reactive test case.
1 parent 36f7f0d commit 5deedaa

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/test/java/org/springframework/data/neo4j/integration/reactive/ReactiveRepositoryIT.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ void findEntityWithSelfReferencesInBothDirections(@Autowired ReactivePetReposito
10021002

10031003
StepVerifier.create(repository.findById(petId)).assertNext(loadedPet -> {
10041004
assertThat(loadedPet.getFriends().get(0).getName()).isEqualTo("Daphne");
1005-
assertThat(loadedPet.getFriends().get(0).getFriends().get(0).getName()).isEqualTo("Luna");
1005+
assertThat(loadedPet.getFriends().get(0).getFriends().get(0).getName()).isEqualTo("Tom");
10061006
}).verifyComplete();
10071007
}
10081008

@@ -1012,6 +1012,14 @@ void countByPropertyWithPossibleCircles(@Autowired ReactivePetRepository reposit
10121012
StepVerifier.create(repository.countByName("Luna")).expectNext(1L).verifyComplete();
10131013
}
10141014

1015+
@Test // GH-2157
1016+
void countByPatternPathProperties(@Autowired ReactivePetRepository repository) {
1017+
createFriendlyPets();
1018+
StepVerifier.create(repository.countByFriendsNameAndFriendsFriendsName("Daphne", "Tom"))
1019+
.expectNextCount(1L)
1020+
.verifyComplete();
1021+
}
1022+
10151023
@Test // GH-2157
10161024
void existsByPropertyWithPossibleCircles(@Autowired ReactivePetRepository repository) {
10171025
createFriendlyPets();
@@ -1021,7 +1029,7 @@ void existsByPropertyWithPossibleCircles(@Autowired ReactivePetRepository reposi
10211029
private long createFriendlyPets() {
10221030
try (Session session = createSession()) {
10231031
return session.run("CREATE (luna:Pet{name:'Luna'})-[:Has]->(daphne:Pet{name:'Daphne'})"
1024-
+ "-[:Has]->(luna)" + "RETURN id(luna) as id").single().get("id").asLong();
1032+
+ "-[:Has]->(:Pet{name:'Tom'})" + "RETURN id(luna) as id").single().get("id").asLong();
10251033
}
10261034
}
10271035
}
@@ -2488,6 +2496,8 @@ interface ReactivePetRepository extends ReactiveNeo4jRepository<Pet, Long> {
24882496
Mono<Long> countByName(String name);
24892497

24902498
Mono<Boolean> existsByName(String name);
2499+
2500+
Mono<Long> countByFriendsNameAndFriendsFriendsName(String friendName, String friendFriendName);
24912501
}
24922502

24932503
interface ReactiveRelationshipRepository extends ReactiveNeo4jRepository<PersonWithRelationship, Long> {

0 commit comments

Comments
 (0)