Skip to content

Commit 8157363

Browse files
author
Fredrich Ombico
committed
Test additional endpoints
1 parent f782783 commit 8157363

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/actuate/GatewayControllerEndpointTests.java

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,29 @@ public class GatewayControllerEndpointTests {
7070

7171
@Test
7272
public void testEndpoints() {
73-
testClient.get().uri("http://localhost:" + port + "/actuator/gateway").exchange().expectStatus().isOk()
74-
.expectBody(List.class).consumeWith(result -> {
75-
List<String> responseBody = result.getResponseBody();
73+
testClient.get().uri("http://localhost:" + port + "/actuator/gateway").exchange()
74+
.expectStatus().isOk().expectBodyList(Map.class).consumeWith(result -> {
75+
List<Map> responseBody = result.getResponseBody();
7676
assertThat(responseBody).isNotEmpty();
77+
assertThat(responseBody).contains(
78+
Map.of("href", "/actuator/gateway/", "methods",
79+
List.of("GET")),
80+
Map.of("href", "/actuator/gateway/globalfilters", "methods",
81+
List.of("GET")),
82+
Map.of("href", "/actuator/gateway/refresh", "methods",
83+
List.of("POST")),
84+
Map.of("href", "/actuator/gateway/routedefinitions",
85+
"methods", List.of("GET")),
86+
Map.of("href", "/actuator/gateway/routefilters", "methods",
87+
List.of("GET")),
88+
Map.of("href", "/actuator/gateway/routepredicates", "methods",
89+
List.of("GET")),
90+
Map.of("href", "/actuator/gateway/routes", "methods",
91+
List.of("POST", "GET")),
92+
Map.of("href", "/actuator/gateway/routes/test-service",
93+
"methods", List.of("POST", "DELETE", "GET")),
94+
Map.of("href", "/actuator/gateway/routes/route_with_metadata",
95+
"methods", List.of("POST", "DELETE", "GET")));
7796
});
7897
}
7998

0 commit comments

Comments
 (0)