use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class AbstractEndpointRequestIntegrationTests method toLinksShouldMatch.
@Test
void toLinksShouldMatch() {
getContextRunner().run((context) -> {
WebTestClient webTestClient = getWebTestClient(context);
webTestClient.get().uri("/actuator").exchange().expectStatus().isOk();
webTestClient.get().uri("/actuator/").exchange().expectStatus().isOk();
});
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class AbstractEndpointRequestIntegrationTests method toAllEndpointsShouldMatch.
@Test
void toAllEndpointsShouldMatch() {
getContextRunner().withPropertyValues("spring.security.user.password=password").run((context) -> {
WebTestClient webTestClient = getWebTestClient(context);
webTestClient.get().uri("/actuator/e2").exchange().expectStatus().isUnauthorized();
webTestClient.get().uri("/actuator/e2").header("Authorization", getBasicAuth()).exchange().expectStatus().isOk();
});
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class MvcEndpointRequestIntegrationTests method toEndpointWhenServletPathSetShouldMatch.
@Test
void toEndpointWhenServletPathSetShouldMatch() {
getContextRunner().withPropertyValues("spring.mvc.servlet.path=/admin").run((context) -> {
WebTestClient webTestClient = getWebTestClient(context);
webTestClient.get().uri("/admin/actuator/e1").exchange().expectStatus().isOk();
});
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class MvcEndpointRequestIntegrationTests method toLinksWhenServletPathSetShouldMatch.
@Test
void toLinksWhenServletPathSetShouldMatch() {
getContextRunner().withPropertyValues("spring.mvc.servlet.path=/admin").run((context) -> {
WebTestClient webTestClient = getWebTestClient(context);
webTestClient.get().uri("/admin/actuator/").exchange().expectStatus().isOk();
webTestClient.get().uri("/admin/actuator").exchange().expectStatus().isOk();
});
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class MvcEndpointRequestIntegrationTests method toAnyEndpointWhenServletPathSetShouldMatchServletEndpoint.
@Test
void toAnyEndpointWhenServletPathSetShouldMatchServletEndpoint() {
getContextRunner().withPropertyValues("spring.mvc.servlet.path=/admin", "spring.security.user.password=password", "management.endpoints.web.exposure.include=se1").run((context) -> {
WebTestClient webTestClient = getWebTestClient(context);
webTestClient.get().uri("/admin/actuator/se1").exchange().expectStatus().isUnauthorized();
webTestClient.get().uri("/admin/actuator/se1").header("Authorization", getBasicAuth()).exchange().expectStatus().isOk();
webTestClient.get().uri("/admin/actuator/se1/list").exchange().expectStatus().isUnauthorized();
webTestClient.get().uri("/admin/actuator/se1/list").header("Authorization", getBasicAuth()).exchange().expectStatus().isOk();
});
}
Aggregations