Merge branch '2.0.x' into 2.1.x

Closes gh-17078
This commit is contained in:
Andy Wilkinson
2019-06-07 10:50:34 +01:00
2691 changed files with 27746 additions and 46049 deletions

View File

@@ -36,8 +36,8 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Madhura Bhave
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
"management.server.port=0", "spring.jersey.application-path=/app" })
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = { "management.server.port=0", "spring.jersey.application-path=/app" })
public class JerseyApplicationPathAndManagementPortTests {
@LocalServerPort
@@ -51,9 +51,8 @@ public class JerseyApplicationPathAndManagementPortTests {
@Test
public void applicationPathShouldNotAffectActuators() {
ResponseEntity<String> entity = this.testRestTemplate.getForEntity(
"http://localhost:" + this.managementPort + "/actuator/health",
String.class);
ResponseEntity<String> entity = this.testRestTemplate
.getForEntity("http://localhost:" + this.managementPort + "/actuator/health", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
}

View File

@@ -38,30 +38,26 @@ public class SampleJerseyApplicationTests {
@Test
public void contextLoads() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/hello",
String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/hello", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
}
@Test
public void reverse() {
ResponseEntity<String> entity = this.restTemplate
.getForEntity("/reverse?input=olleh", String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse?input=olleh", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("hello");
}
@Test
public void validation() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse",
String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/reverse", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.BAD_REQUEST);
}
@Test
public void actuatorStatus() {
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health",
String.class);
ResponseEntity<String> entity = this.restTemplate.getForEntity("/actuator/health", String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
}