Browse Source

Uses RouterFunction.and() rather than andOther()

This avoids a cast to RouterFunction<ServerResponse>.

See gh-2949
pull/3006/head
sgibb 2 years ago
parent
commit
540c0100ea
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 8
      spring-cloud-gateway-server-mvc/src/test/java/org/springframework/cloud/gateway/server/mvc/ServerMvcIntegrationTests.java

8
spring-cloud-gateway-server-mvc/src/test/java/org/springframework/cloud/gateway/server/mvc/ServerMvcIntegrationTests.java

@ -454,12 +454,12 @@ public class ServerMvcIntegrationTests { @@ -454,12 +454,12 @@ public class ServerMvcIntegrationTests {
@Bean
public RouterFunction<ServerResponse> gatewayRouterFunctionsSetStatusAndAddRespHeader() {
// @formatter:off
return (RouterFunction<ServerResponse>) route("testsetstatus")
return route("testsetstatus")
.GET("/status/{status}", http())
.before(new HttpbinUriResolver())
.after(setStatus(HttpStatus.TOO_MANY_REQUESTS))
.after(addResponseHeader("X-Status", "{status}"))
.build().andOther(route()
.build().and(route()
.GET("/anything/addresheader", http())
.before(routeId("testaddresponseheader"))
.before(new HttpbinUriResolver())
@ -701,10 +701,10 @@ public class ServerMvcIntegrationTests { @@ -701,10 +701,10 @@ public class ServerMvcIntegrationTests {
// @formatter:off
return route()
.nest(path("/anything/nested").and(header("test", "nested")), () ->
(RouterFunction<ServerResponse>) route("nested1").GET("/nested1", http())
route("nested1").GET("/nested1", http())
.before(new HttpbinUriResolver())
.filter(addRequestHeader("X-Test", "nested1"))
.build().andOther(
.build().and(
route("nested2").GET("/nested2", http())
.before(new HttpbinUriResolver())
.filter(addRequestHeader("X-Test", "nested2")).build()))

Loading…
Cancel
Save