mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-24 15:49:26 +00:00
Merge branch '7.0.x'
This commit is contained in:
@@ -375,7 +375,7 @@ public class ReactiveAdapterRegistry {
|
||||
void registerAdapters(ReactiveAdapterRegistry registry) {
|
||||
ReactiveTypeDescriptor uniDesc = ReactiveTypeDescriptor.singleOptionalValue(
|
||||
io.smallrye.mutiny.Uni.class,
|
||||
() -> io.smallrye.mutiny.Uni.createFrom().nothing());
|
||||
() -> io.smallrye.mutiny.Uni.createFrom().nullItem());
|
||||
ReactiveTypeDescriptor multiDesc = ReactiveTypeDescriptor.multiValue(
|
||||
io.smallrye.mutiny.Multi.class,
|
||||
() -> io.smallrye.mutiny.Multi.createFrom().empty());
|
||||
|
||||
@@ -300,6 +300,20 @@ class ReactiveAdapterRegistryTests {
|
||||
assertThat(((Mono<Integer>) target).block(FIVE_SECONDS)).isEqualTo(Integer.valueOf(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
void fromNullValue() {
|
||||
Object target = getAdapter(Uni.class).toPublisher(null);
|
||||
assertThat(target).isInstanceOf(Mono.class);
|
||||
assertThat(((Mono<Integer>) target).block(FIVE_SECONDS)).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void toUniFromEmptyPublisher() {
|
||||
Object target = getAdapter(Uni.class).fromPublisher(Mono.empty());
|
||||
assertThat(target).isInstanceOf(Uni.class);
|
||||
assertThat(((Uni<Integer>) target).await().atMost(FIVE_SECONDS)).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void toMulti() {
|
||||
List<Integer> sequence = Arrays.asList(1, 2, 3);
|
||||
|
||||
Reference in New Issue
Block a user