This commit is contained in:
Phillip Webb
2017-11-01 15:48:03 -07:00
parent 44d8e09aac
commit c55b5d7111
62 changed files with 237 additions and 229 deletions

View File

@@ -62,8 +62,8 @@ public class ManagementAddressActuatorApplicationTests {
@Test
public void testHealth() throws Exception {
ResponseEntity<String> entity = new TestRestTemplate()
.withBasicAuth("user", getPassword())
.getForEntity("http://localhost:" + this.managementPort + "/admin/application/health",
.withBasicAuth("user", getPassword()).getForEntity("http://localhost:"
+ this.managementPort + "/admin/application/health",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("\"status\":\"UP\"");

View File

@@ -49,9 +49,9 @@ public class ServletPathSampleActuatorApplicationTests {
@Test
public void testErrorPath() throws Exception {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = this.restTemplate.withBasicAuth("user", getPassword())
.getForEntity("/spring/error",
Map.class);
ResponseEntity<Map> entity = this.restTemplate
.withBasicAuth("user", getPassword())
.getForEntity("/spring/error", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
@SuppressWarnings("unchecked")
Map<String, Object> body = entity.getBody();