From 807509abfe234568413bb52e6dba399057e2eacd Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Tue, 23 Jul 2019 15:54:12 -0400 Subject: [PATCH] Runs test with verbose mode --- .../actuate/GatewayControllerEndpointTests.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/actuate/GatewayControllerEndpointTests.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/actuate/GatewayControllerEndpointTests.java index ffc69c74..ff7e7730 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/actuate/GatewayControllerEndpointTests.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/actuate/GatewayControllerEndpointTests.java @@ -39,7 +39,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @RunWith(SpringRunner.class) -@SpringBootTest(properties = "management.endpoints.web.exposure.include=*", webEnvironment = RANDOM_PORT) +@SpringBootTest(properties = { "management.endpoints.web.exposure.include=*", + "spring.cloud.gateway.actuator.verbose.enabled=true" }, webEnvironment = RANDOM_PORT) public class GatewayControllerEndpointTests { @Autowired @@ -66,7 +67,8 @@ public class GatewayControllerEndpointTests { @Test public void testGetSpecificRoute() { - testClient.get().uri("http://localhost:" + port + "/actuator/gateway/routes/test-service") + testClient.get() + .uri("http://localhost:" + port + "/actuator/gateway/routes/test-service") .exchange().expectStatus().isOk().expectBodyList(Map.class) .consumeWith(result -> { List responseBody = result.getResponseBody(); @@ -80,12 +82,15 @@ public class GatewayControllerEndpointTests { @EnableAutoConfiguration @Import(PermitAllSecurityConfiguration.class) static class TestConfig { + @Bean RouteLocator testRouteLocator(RouteLocatorBuilder routeLocatorBuilder) { return routeLocatorBuilder.routes() - .route("test-service", routePredicate -> routePredicate.path("/test-service/**").uri("lb://test-service")) + .route("test-service", + r -> r.path("/test-service/**").uri("lb://test-service")) .build(); } + } }