Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

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 @@ -45,6 +45,7 @@
* @author Mark Paluch
* @author Oliver Gierke
* @author Christoph Strobl
* @author Ruben J Garcia
* @since 2.0
*/
@RequiredArgsConstructor
Expand Down Expand Up @@ -97,7 +98,7 @@ public <S extends T> Mono<S> findOne(Example<S> example) {
return Mono.error(new IncorrectResultSizeDataAccessException(1));
}
return Mono.just(vals.iterator().next());
}).single();
}).next();
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
*
* @author Mark Paluch
* @author Christoph Strobl
* @author Ruben J Garcia
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:reactive-infrastructure.xml")
Expand Down Expand Up @@ -441,6 +442,14 @@ public void findOneShouldEmitIncorrectResultSizeDataAccessExceptionWhenMoreThanO
StepVerifier.create(repository.findOne(example)).expectError(IncorrectResultSizeDataAccessException.class);
}

@Test // DATAMONGO-1907
public void existsByExampleShouldReturnNonExistingWithoutThrowException() {

Example<ReactivePerson> example = Example.of(new ReactivePerson("foo", "bar", -1));

StepVerifier.create(repository.findOne(example)).verifyComplete();
}

interface ReactivePersonRepostitory extends ReactiveMongoRepository<ReactivePerson, String> {

Flux<ReactivePerson> findByLastname(String lastname);
Expand Down