Properly handle Flux<?> and Flux<Object> in WebFlux
Issue: SPR-15464
This commit is contained in:
@@ -29,6 +29,7 @@ import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.StepVerifier;
|
||||
import rx.Completable;
|
||||
@@ -132,6 +133,10 @@ public class ResponseEntityResultHandlerTests {
|
||||
|
||||
returnType = on(TestController.class).resolveReturnType(Completable.class);
|
||||
assertFalse(this.resultHandler.supports(handlerResult(value, returnType)));
|
||||
|
||||
// SPR-15464
|
||||
returnType = on(TestController.class).resolveReturnType(Flux.class);
|
||||
assertFalse(this.resultHandler.supports(handlerResult(value, returnType)));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -381,6 +386,7 @@ public class ResponseEntityResultHandlerTests {
|
||||
|
||||
Mono<ResponseEntity<?>> monoResponseEntityWildcard() { return null; }
|
||||
|
||||
Flux<?> fluxWildcard() { return null; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -97,6 +97,9 @@ public class ViewResolutionResultHandlerTests {
|
||||
|
||||
testSupports(on(Handler.class).annotPresent(ModelAttribute.class).resolveReturnType(Long.class));
|
||||
testDoesNotSupport(on(Handler.class).annotNotPresent(ModelAttribute.class).resolveReturnType(Long.class));
|
||||
|
||||
// SPR-15464
|
||||
testSupports(on(Handler.class).resolveReturnType(Mono.class));
|
||||
}
|
||||
|
||||
private void testSupports(MethodParameter returnType) {
|
||||
@@ -427,6 +430,7 @@ public class ViewResolutionResultHandlerTests {
|
||||
Long longValue() { return null; }
|
||||
@ModelAttribute("myLong") Long longModelAttribute() { return null; }
|
||||
|
||||
Mono<?> monoWildcard() { return null; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user