Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ private <T> Mono<Tuple2<T, DynamicLabels>> determineDynamicLabels(T entityToBeSa
.one()
.map(m -> (Collection<String>) m.get(Constants.NAME_OF_LABELS))
.switchIfEmpty(Mono.just(Collections.emptyList()))
.zipWith(Mono.just((Collection<String>) propertyAccessor.getProperty(p)))
.zipWith(Mono.justOrEmpty((Collection<String>) propertyAccessor.getProperty(p)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.zipWith(Mono.justOrEmpty((Collection<String>) propertyAccessor.getProperty(p)))
.zipWith(Mono.just(
(Collection<String>) Objects.requireNonNullElseGet(propertyAccessor.getProperty(p), List::of)))

Otherwise the flow does not run at all and you don't get any dynamic label.

.map(t -> Tuples.of(entityToBeSaved, new DynamicLabels(entityMetaData, t.getT1(), t.getT2())));
}).orElse(Mono.just(Tuples.of(entityToBeSaved, DynamicLabels.EMPTY)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ReactiveNeo4jClientKotlinInteropIT @Autowired constructor(
}.one()

StepVerifier.create(queen)
.expectNextMatches { it.name == "Queen" && it.member.size == 4 }
.expectNextMatches { it!!.name == "Queen" && it.member.size == 4 }
.verifyComplete()

StepVerifier.create(neo4jClient.query("MATCH (n:IDontExists) RETURN id(n)").fetchAs<Long>().one())
Expand Down