|
|
@ -16,6 +16,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.actuate.autoconfigure.integrationtest;
|
|
|
|
package org.springframework.boot.actuate.autoconfigure.integrationtest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.Duration;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -63,7 +64,8 @@ class JerseyEndpointIntegrationTests {
|
|
|
|
int port = context
|
|
|
|
int port = context
|
|
|
|
.getSourceApplicationContext(AnnotationConfigServletWebServerApplicationContext.class)
|
|
|
|
.getSourceApplicationContext(AnnotationConfigServletWebServerApplicationContext.class)
|
|
|
|
.getWebServer().getPort();
|
|
|
|
.getWebServer().getPort();
|
|
|
|
WebTestClient client = WebTestClient.bindToServer().baseUrl("http://localhost:" + port).build();
|
|
|
|
WebTestClient client = WebTestClient.bindToServer().baseUrl("http://localhost:" + port)
|
|
|
|
|
|
|
|
.responseTimeout(Duration.ofMinutes(5)).build();
|
|
|
|
client.get().uri("/actuator").exchange().expectStatus().isNotFound();
|
|
|
|
client.get().uri("/actuator").exchange().expectStatus().isNotFound();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -81,7 +83,8 @@ class JerseyEndpointIntegrationTests {
|
|
|
|
contextRunner.run((context) -> {
|
|
|
|
contextRunner.run((context) -> {
|
|
|
|
int port = context.getSourceApplicationContext(AnnotationConfigServletWebServerApplicationContext.class)
|
|
|
|
int port = context.getSourceApplicationContext(AnnotationConfigServletWebServerApplicationContext.class)
|
|
|
|
.getWebServer().getPort();
|
|
|
|
.getWebServer().getPort();
|
|
|
|
WebTestClient client = WebTestClient.bindToServer().baseUrl("http://localhost:" + port).build();
|
|
|
|
WebTestClient client = WebTestClient.bindToServer().baseUrl("http://localhost:" + port)
|
|
|
|
|
|
|
|
.responseTimeout(Duration.ofMinutes(5)).build();
|
|
|
|
client.get().uri("/actuator").exchange().expectStatus().isUnauthorized();
|
|
|
|
client.get().uri("/actuator").exchange().expectStatus().isUnauthorized();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -91,7 +94,8 @@ class JerseyEndpointIntegrationTests {
|
|
|
|
getContextRunner(userConfigurations).run((context) -> {
|
|
|
|
getContextRunner(userConfigurations).run((context) -> {
|
|
|
|
int port = context.getSourceApplicationContext(AnnotationConfigServletWebServerApplicationContext.class)
|
|
|
|
int port = context.getSourceApplicationContext(AnnotationConfigServletWebServerApplicationContext.class)
|
|
|
|
.getWebServer().getPort();
|
|
|
|
.getWebServer().getPort();
|
|
|
|
WebTestClient client = WebTestClient.bindToServer().baseUrl("http://localhost:" + port).build();
|
|
|
|
WebTestClient client = WebTestClient.bindToServer().baseUrl("http://localhost:" + port)
|
|
|
|
|
|
|
|
.responseTimeout(Duration.ofMinutes(5)).build();
|
|
|
|
client.get().uri("/actuator").exchange().expectStatus().isOk().expectBody().jsonPath("_links.beans")
|
|
|
|
client.get().uri("/actuator").exchange().expectStatus().isOk().expectBody().jsonPath("_links.beans")
|
|
|
|
.isNotEmpty().jsonPath("_links.restcontroller").doesNotExist().jsonPath("_links.controller")
|
|
|
|
.isNotEmpty().jsonPath("_links.restcontroller").doesNotExist().jsonPath("_links.controller")
|
|
|
|
.doesNotExist();
|
|
|
|
.doesNotExist();
|
|
|
|