Update gateway actuator metrics test to use @ClassPathExclusions to verify gateway doesn't fall over when actuator metrics are not added as project dependency
This commit is contained in:
@@ -45,6 +45,7 @@ import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
@Import(AdditionalRoutes.class)
|
||||
public class GatewaySampleApplication {
|
||||
|
||||
public static final String HELLO_FROM_FAKE_ACTUATOR_METRICS_GATEWAY_REQUESTS = "hello from fake /actuator/metrics/gateway.requests";
|
||||
@Value("${test.uri:http://httpbin.org:80}")
|
||||
String uri;
|
||||
|
||||
@@ -135,6 +136,14 @@ public class GatewaySampleApplication {
|
||||
return route;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RouterFunction<ServerResponse> testWhenMetricPathIsNotMeet() {
|
||||
RouterFunction<ServerResponse> route = RouterFunctions.route(
|
||||
RequestPredicates.path("/actuator/metrics/gateway.requests"),
|
||||
request -> ServerResponse.ok().body(BodyInserters.fromObject(HELLO_FROM_FAKE_ACTUATOR_METRICS_GATEWAY_REQUESTS)));
|
||||
return route;
|
||||
}
|
||||
|
||||
static class Hello {
|
||||
String message;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user