Return actual status code not 200 to machine client
Machine clients are much more fussy than browsers and we should take care to preserve the HTTP status for them. Fixes gh-596
This commit is contained in:
@@ -50,7 +50,7 @@ public class EndpointsPropertiesSampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = RestTemplates.get("user", "password").getForEntity(
|
||||
"http://localhost:8080/oops", Map.class);
|
||||
assertEquals(HttpStatus.OK, entity.getStatusCode());
|
||||
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, entity.getStatusCode());
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = entity.getBody();
|
||||
assertEquals("None", body.get("error"));
|
||||
|
||||
@@ -158,7 +158,7 @@ public class SampleActuatorApplicationTests {
|
||||
@SuppressWarnings("rawtypes")
|
||||
ResponseEntity<Map> entity = RestTemplates.get().getForEntity(
|
||||
"http://localhost:8080/error", Map.class);
|
||||
assertEquals(HttpStatus.OK, entity.getStatusCode());
|
||||
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, entity.getStatusCode());
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> body = entity.getBody();
|
||||
assertEquals("None", body.get("error"));
|
||||
|
||||
Reference in New Issue
Block a user