Browse Source

polish for loggingˆ

pull/3006/head
sgibb 1 year ago
parent
commit
aef79a3507
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 15
      spring-cloud-gateway-server-mvc/src/test/java/org/springframework/cloud/gateway/server/mvc/ServerMvcIntegrationTests.java

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

@ -67,6 +67,7 @@ import org.springframework.web.bind.annotation.PostMapping; @@ -67,6 +67,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.function.HandlerFunction;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.ServerRequest;
import org.springframework.web.servlet.function.ServerResponse;
@ -587,7 +588,7 @@ public class ServerMvcIntegrationTests { @@ -587,7 +588,7 @@ public class ServerMvcIntegrationTests {
@Bean
public RouterFunction<ServerResponse> nonGatewayRouterFunctions(TestHandler testHandler) {
return route(GET("/hello"), testHandler::hello).withAttribute(MvcUtils.GATEWAY_ROUTE_ID_ATTR, "hello");
return route(GET("/hello"), testHandler).withAttribute(MvcUtils.GATEWAY_ROUTE_ID_ATTR, "hello");
}
@Bean
@ -840,7 +841,7 @@ public class ServerMvcIntegrationTests { @@ -840,7 +841,7 @@ public class ServerMvcIntegrationTests {
@Bean
public RouterFunction<ServerResponse> gatewayRouterFunctionsSetRequestHostHeader() {
// @formatter:off
return route("testsetrequestheader")
return route("testsetrequesthostheader")
.route(host("**.setrequesthostheader.org"), http())
.filter(new HttpbinUriResolver())
.filter(setRequestHostHeader("otherhost.io"))
@ -1087,12 +1088,16 @@ public class ServerMvcIntegrationTests { @@ -1087,12 +1088,16 @@ public class ServerMvcIntegrationTests {
}
protected static class TestHandler {
public ServerResponse hello(ServerRequest request) {
protected static class TestHandler implements HandlerFunction<ServerResponse> {
@Override
public ServerResponse handle(ServerRequest request) {
return ServerResponse.ok().body("Hello");
}
@Override
public String toString() {
return "TestHandler Hello";
}
}
}

Loading…
Cancel
Save