mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-22 00:29:01 +00:00
Update path in actuator sample tests
This commit is contained in:
+4
-4
@@ -51,13 +51,13 @@ public class CorsSampleActuatorApplicationTests {
|
||||
|
||||
@Test
|
||||
public void sensitiveEndpointShouldReturnUnauthorized() throws Exception {
|
||||
ResponseEntity<Map> entity = this.testRestTemplate.getForEntity("/env", Map.class);
|
||||
ResponseEntity<Map> entity = this.testRestTemplate.getForEntity("/application/env", Map.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void preflightRequestForInsensitiveShouldReturnOk() throws Exception {
|
||||
RequestEntity<?> healthRequest = RequestEntity.options(new URI("/health"))
|
||||
RequestEntity<?> healthRequest = RequestEntity.options(new URI("/application/health"))
|
||||
.header("Origin","http://localhost:8080")
|
||||
.header("Access-Control-Request-Method", "GET")
|
||||
.build();
|
||||
@@ -67,7 +67,7 @@ public class CorsSampleActuatorApplicationTests {
|
||||
|
||||
@Test
|
||||
public void preflightRequestForSensitiveEndpointShouldReturnOk() throws Exception {
|
||||
RequestEntity<?> entity = RequestEntity.options(new URI("/env"))
|
||||
RequestEntity<?> entity = RequestEntity.options(new URI("/application/env"))
|
||||
.header("Origin","http://localhost:8080")
|
||||
.header("Access-Control-Request-Method", "GET")
|
||||
.build();
|
||||
@@ -77,7 +77,7 @@ public class CorsSampleActuatorApplicationTests {
|
||||
|
||||
@Test
|
||||
public void preflightRequestWhenCorsConfigInvalidShouldReturnForbidden() throws Exception {
|
||||
RequestEntity<?> entity = RequestEntity.options(new URI("/health"))
|
||||
RequestEntity<?> entity = RequestEntity.options(new URI("/application/health"))
|
||||
.header("Origin","http://localhost:9095")
|
||||
.header("Access-Control-Request-Method", "GET")
|
||||
.build();
|
||||
|
||||
Reference in New Issue
Block a user