INT-4479: RequestEntity as root for status code

JIRA: https://jira.spring.io/browse/INT-4479

For better user experience expose a `RequestEntity<?>` as a root object
for evaluation context for `statusCodeExpression` execution
This commit is contained in:
Artem Bilan
2018-10-04 16:26:01 -04:00
committed by Gary Russell
parent a05004ae38
commit 262e624ef4
10 changed files with 130 additions and 76 deletions

View File

@@ -355,7 +355,10 @@ public class WebFluxDslTests {
.from(WebFlux.inboundChannelAdapter("/reactivePost")
.requestMapping(m -> m.methods(HttpMethod.POST))
.requestPayloadType(ResolvableType.forClassWithGenerics(Flux.class, String.class))
.statusCodeFunction(m -> HttpStatus.ACCEPTED))
.statusCodeFunction(e ->
HttpMethod.POST.equals(e.getMethod())
? HttpStatus.ACCEPTED
: HttpStatus.BAD_REQUEST))
.channel(c -> c.queue("storeChannel"))
.get();
}