Polishing.
Add since and author tags. Add ticket references to tests. Reformat code. See #2471
This commit is contained in:
1
pom.xml
1
pom.xml
@@ -148,7 +148,6 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- SmallRye Mutiny, see:https://smallrye.io/smallrye-mutiny/ -->
|
||||
<dependency>
|
||||
<groupId>io.smallrye.reactive</groupId>
|
||||
<artifactId>mutiny</artifactId>
|
||||
|
||||
@@ -17,8 +17,6 @@ package org.springframework.data.repository.util;
|
||||
|
||||
import io.reactivex.Flowable;
|
||||
import io.reactivex.Maybe;
|
||||
import io.smallrye.mutiny.Multi;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import kotlinx.coroutines.flow.Flow;
|
||||
import kotlinx.coroutines.flow.FlowKt;
|
||||
import kotlinx.coroutines.reactive.ReactiveFlowKt;
|
||||
@@ -62,6 +60,7 @@ import org.springframework.util.ClassUtils;
|
||||
* @author Mark Paluch
|
||||
* @author Oliver Gierke
|
||||
* @author Christoph Strobl
|
||||
* @author Hantsy Bai
|
||||
* @since 2.0
|
||||
* @see ReactiveWrappers
|
||||
* @see ReactiveAdapterRegistry
|
||||
@@ -536,6 +535,9 @@ public abstract class ReactiveWrapperConverters {
|
||||
|
||||
/**
|
||||
* Wrapper for SmallRye Mutiny's {@link io.smallrye.mutiny.Uni}.
|
||||
*
|
||||
* @author Hantsy Bai
|
||||
* @since 2.6
|
||||
*/
|
||||
private enum UniWrapper implements ReactiveTypeWrapper<io.smallrye.mutiny.Uni<?>> {
|
||||
|
||||
@@ -548,12 +550,15 @@ public abstract class ReactiveWrapperConverters {
|
||||
|
||||
@Override
|
||||
public io.smallrye.mutiny.Uni<?> map(Object wrapper, Function<Object, Object> function) {
|
||||
return ((io.smallrye.mutiny.Uni<?>) wrapper).map(function::apply);
|
||||
return ((io.smallrye.mutiny.Uni<?>) wrapper).map(function);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper for SmallRye Mutiny's {@link io.smallrye.mutiny.Multi}.
|
||||
*
|
||||
* @author Hantsy Bai
|
||||
* @since 2.6
|
||||
*/
|
||||
private enum MultiWrapper implements ReactiveTypeWrapper<io.smallrye.mutiny.Multi<?>> {
|
||||
|
||||
@@ -566,7 +571,7 @@ public abstract class ReactiveWrapperConverters {
|
||||
|
||||
@Override
|
||||
public io.smallrye.mutiny.Multi<?> map(Object wrapper, Function<Object, Object> function) {
|
||||
return ((io.smallrye.mutiny.Multi<?>) wrapper).map(function::apply);
|
||||
return ((io.smallrye.mutiny.Multi<?>) wrapper).map(function);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.springframework.util.ClassUtils;
|
||||
* @author Christoph Strobl
|
||||
* @author Oliver Gierke
|
||||
* @author Gerrit Meier
|
||||
* @author Hantsy Bai
|
||||
* @since 2.0
|
||||
* @see org.reactivestreams.Publisher
|
||||
* @see rx.Single
|
||||
@@ -59,6 +60,8 @@ import org.springframework.util.ClassUtils;
|
||||
* @see io.reactivex.rxjava3.core.Observable
|
||||
* @see io.reactivex.rxjava3.core.Completable
|
||||
* @see io.reactivex.rxjava3.core.Flowable
|
||||
* @see io.smallrye.mutiny.Multi
|
||||
* @see io.smallrye.mutiny.Uni
|
||||
* @see Mono
|
||||
* @see Flux
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.reactivestreams.Publisher;
|
||||
* Unit tests for {@link ReactiveWrapperConverters}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Hantsy Bai
|
||||
*/
|
||||
class ReactiveWrapperConvertersUnitTests {
|
||||
|
||||
@@ -84,7 +85,7 @@ class ReactiveWrapperConvertersUnitTests {
|
||||
assertThat(ReactiveWrapperConverters.supports(io.reactivex.rxjava3.core.Completable.class)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // GH-2471
|
||||
void shouldSupportMutinyTypes() {
|
||||
|
||||
assertThat(ReactiveWrapperConverters.supports(Uni.class)).isTrue();
|
||||
|
||||
@@ -34,10 +34,11 @@ import org.reactivestreams.Publisher;
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Gerrit Meier
|
||||
* @author Hantsy Bai
|
||||
*/
|
||||
class ReactiveWrappersUnitTests {
|
||||
|
||||
@Test // DATACMNS-836, DATACMNS-1653, DATACMNS-1753
|
||||
@Test // DATACMNS-836, DATACMNS-1653, DATACMNS-1753, GH-2471
|
||||
void isSingleLikeShouldReportCorrectNoTypes() {
|
||||
|
||||
assertThat(ReactiveWrappers.isNoValueType(Mono.class)).isFalse();
|
||||
@@ -59,7 +60,7 @@ class ReactiveWrappersUnitTests {
|
||||
assertThat(ReactiveWrappers.isNoValueType(io.smallrye.mutiny.Multi.class)).isFalse();
|
||||
}
|
||||
|
||||
@Test // DATACMNS-836, DATACMNS-1653, DATACMNS-1753
|
||||
@Test // DATACMNS-836, DATACMNS-1653, DATACMNS-1753, GH-2471
|
||||
void isSingleLikeShouldReportCorrectSingleTypes() {
|
||||
|
||||
assertThat(ReactiveWrappers.isSingleValueType(Mono.class)).isTrue();
|
||||
@@ -83,7 +84,7 @@ class ReactiveWrappersUnitTests {
|
||||
assertThat(ReactiveWrappers.isSingleValueType(io.smallrye.mutiny.Multi.class)).isFalse();
|
||||
}
|
||||
|
||||
@Test // DATACMNS-836, DATACMNS-1653, DATACMNS-1753
|
||||
@Test // DATACMNS-836, DATACMNS-1653, DATACMNS-1753, GH-2471
|
||||
void isCollectionLikeShouldReportCorrectCollectionTypes() {
|
||||
|
||||
assertThat(ReactiveWrappers.isMultiValueType(Mono.class)).isFalse();
|
||||
|
||||
Reference in New Issue
Block a user