diff --git a/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java b/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java index 8601a0e68..e122a16c9 100644 --- a/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java +++ b/src/main/java/org/springframework/data/repository/reactive/ReactiveCrudRepository.java @@ -91,7 +91,7 @@ public interface ReactiveCrudRepository extends Repo Mono exists(ID id); /** - * Returns whether an entity with the given id exists supplied by a {@link Mono}. + * Returns whether an entity with the given id, supplied by a {@link Mono}, exists. * * @param id must not be {@literal null}. * @return {@literal true} if an entity with the given id exists, {@literal false} otherwise diff --git a/src/main/java/org/springframework/data/repository/reactive/RxJava1CrudRepository.java b/src/main/java/org/springframework/data/repository/reactive/RxJava1CrudRepository.java index 21551f318..d390295fe 100644 --- a/src/main/java/org/springframework/data/repository/reactive/RxJava1CrudRepository.java +++ b/src/main/java/org/springframework/data/repository/reactive/RxJava1CrudRepository.java @@ -91,7 +91,7 @@ public interface RxJava1CrudRepository extends Repos Single exists(ID id); /** - * Returns whether an entity with the given id exists supplied by a {@link Single}. + * Returns whether an entity with the given id, supplied by a {@link Single}, exists. * * @param id must not be {@literal null}. * @return {@literal true} if an entity with the given id exists, {@literal false} otherwise. diff --git a/src/main/java/org/springframework/data/repository/reactive/RxJava2CrudRepository.java b/src/main/java/org/springframework/data/repository/reactive/RxJava2CrudRepository.java index dc99502a3..a26704f1b 100644 --- a/src/main/java/org/springframework/data/repository/reactive/RxJava2CrudRepository.java +++ b/src/main/java/org/springframework/data/repository/reactive/RxJava2CrudRepository.java @@ -31,6 +31,7 @@ import org.springframework.data.repository.Repository; * * @author Mark Paluch * @since 2.0 + * @see Maybe * @see Single * @see Flowable * @see Completable @@ -93,7 +94,7 @@ public interface RxJava2CrudRepository extends Repos Single exists(ID id); /** - * Returns whether an entity with the given id exists supplied by a {@link Single}. + * Returns whether an entity with the given id, supplied by a {@link Single}, exists. * * @param id must not be {@literal null}. * @return {@literal true} if an entity with the given id exists, {@literal false} otherwise. diff --git a/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java b/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java index 3e691d631..e263b6023 100644 --- a/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java +++ b/src/main/java/org/springframework/data/repository/util/ReactiveWrapperConverters.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -722,7 +722,7 @@ public class ReactiveWrapperConverters { @Override public io.reactivex.Observable convert(Publisher source) { - return (io.reactivex.Observable) REACTIVE_ADAPTER_REGISTRY.getAdapter(io.reactivex.Single.class) + return (io.reactivex.Observable) REACTIVE_ADAPTER_REGISTRY.getAdapter(io.reactivex.Observable.class) .fromPublisher(source); } } diff --git a/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java b/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java index 300709ca1..52c0b5c63 100644 --- a/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -175,6 +175,22 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(ReactiveWrapperConverters.toWrapper(foo, Publisher.class)).isInstanceOf(Publisher.class); } + @Test // DATACMNS-988 + public void toWrapperShouldConvertPublisherToRxJava2Observable() { + + Flux foo = Flux.just("foo"); + assertThat(ReactiveWrapperConverters.toWrapper(foo, io.reactivex.Observable.class)) + .isInstanceOf(io.reactivex.Observable.class); + } + + @Test // DATACMNS-988 + public void toWrapperShouldConvertPublisherToRxJava2Flowable() { + + Flux foo = Flux.just("foo"); + assertThat(ReactiveWrapperConverters.toWrapper(foo, io.reactivex.Flowable.class)) + .isInstanceOf(io.reactivex.Flowable.class); + } + @Test // DATACMNS-836 public void toWrapperShouldConvertMonoToFlux() {