This commit is contained in:
Stephane Nicoll
2017-12-12 11:57:24 +01:00
parent 97c91eee94
commit 23218add90
615 changed files with 2832 additions and 3224 deletions

View File

@@ -54,7 +54,7 @@ public class CorsSampleActuatorApplicationTests {
private ApplicationContext applicationContext;
@Before
public void setUp() throws Exception {
public void setUp() {
RestTemplate restTemplate = new RestTemplate();
LocalHostUriTemplateHandler handler = new LocalHostUriTemplateHandler(
this.applicationContext.getEnvironment(), "http");
@@ -64,7 +64,7 @@ public class CorsSampleActuatorApplicationTests {
}
@Test
public void endpointShouldReturnUnauthorized() throws Exception {
public void endpointShouldReturnUnauthorized() {
ResponseEntity<?> entity = this.testRestTemplate.getForEntity("/actuator/env",
Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);

View File

@@ -48,7 +48,7 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
private int managementPort = 9011;
@Test
public void testHome() throws Exception {
public void testHome() {
ResponseEntity<String> entity = new TestRestTemplate("user", "password")
.getForEntity("http://localhost:" + this.port, String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
@@ -56,7 +56,7 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
}
@Test
public void testSecureActuator() throws Exception {
public void testSecureActuator() {
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.managementPort + "/management/actuator/env",
String.class);
@@ -64,7 +64,7 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
}
@Test
public void testInsecureActuator() throws Exception {
public void testInsecureActuator() {
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.managementPort + "/management/actuator/health",
String.class);
@@ -73,7 +73,7 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
}
@Test
public void testMissing() throws Exception {
public void testMissing() {
ResponseEntity<String> entity = new TestRestTemplate("admin", "admin")
.getForEntity("http://localhost:" + this.managementPort
+ "/management/actuator/missing", String.class);

View File

@@ -41,7 +41,7 @@ public class SampleActuatorCustomSecurityApplicationTests {
private TestRestTemplate restTemplate;
@Test
public void homeIsSecure() throws Exception {
public void homeIsSecure() {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = this.restTemplate.getForEntity("/", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
@@ -52,7 +52,7 @@ public class SampleActuatorCustomSecurityApplicationTests {
}
@Test
public void testInsecureApplicationPath() throws Exception {
public void testInsecureApplicationPath() {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = this.restTemplate.getForEntity("/foo", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
@@ -63,7 +63,7 @@ public class SampleActuatorCustomSecurityApplicationTests {
}
@Test
public void testInsecureStaticResources() throws Exception {
public void testInsecureStaticResources() {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/css/bootstrap.min.css", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
@@ -71,7 +71,7 @@ public class SampleActuatorCustomSecurityApplicationTests {
}
@Test
public void insecureActuator() throws Exception {
public void insecureActuator() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
@@ -79,7 +79,7 @@ public class SampleActuatorCustomSecurityApplicationTests {
}
@Test
public void secureActuator() throws Exception {
public void secureActuator() {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = this.restTemplate.getForEntity("/actuator/env",
Map.class);