Skip to content

Commit 36f56d0

Browse files
committed
Merge branch '2.1.x'
2 parents aef92b9 + 612a929 commit 36f56d0

File tree

5 files changed

+31
-53
lines changed

5 files changed

+31
-53
lines changed

spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,8 +35,7 @@ public class SampleGlassfishDeployApplicationIT {
3535
public void testHome() throws Exception {
3636
String url = "http://localhost:" + this.port + "/bootapp/";
3737
System.out.println(url);
38-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
39-
String.class);
38+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
4039
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
4140
assertThat(entity.getBody()).isEqualTo("Hello World");
4241
}
@@ -45,8 +44,7 @@ public void testHome() throws Exception {
4544
public void testHealth() throws Exception {
4645
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
4746
System.out.println(url);
48-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
49-
String.class);
47+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
5048
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
5149
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
5250
}

spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -49,64 +49,50 @@ public void testHome() throws Exception {
4949
public void testHealth() throws Exception {
5050
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
5151
System.out.println(url);
52-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
53-
String.class);
52+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
5453
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
5554
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
5655
}
5756

5857
@Test
59-
public void errorFromExceptionForRequestAcceptingAnythingProducesAJsonResponse()
60-
throws Exception {
61-
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.ALL,
62-
MediaType.APPLICATION_JSON);
58+
public void errorFromExceptionForRequestAcceptingAnythingProducesAJsonResponse() throws Exception {
59+
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.ALL, MediaType.APPLICATION_JSON);
6360
}
6461

6562
@Test
66-
public void errorFromExceptionForRequestAcceptingJsonProducesAJsonResponse()
67-
throws Exception {
68-
assertThatPathProducesExpectedResponse("/bootapp/exception",
69-
MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON);
63+
public void errorFromExceptionForRequestAcceptingJsonProducesAJsonResponse() throws Exception {
64+
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.APPLICATION_JSON,
65+
MediaType.APPLICATION_JSON);
7066
}
7167

7268
@Test
73-
public void errorFromExceptionForRequestAcceptingHtmlProducesAnHtmlResponse()
74-
throws Exception {
75-
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.TEXT_HTML,
76-
MediaType.TEXT_HTML);
69+
public void errorFromExceptionForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception {
70+
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.TEXT_HTML, MediaType.TEXT_HTML);
7771
}
7872

7973
@Test
80-
public void sendErrorForRequestAcceptingAnythingProducesAJsonResponse()
81-
throws Exception {
82-
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.ALL,
83-
MediaType.APPLICATION_JSON);
74+
public void sendErrorForRequestAcceptingAnythingProducesAJsonResponse() throws Exception {
75+
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.ALL, MediaType.APPLICATION_JSON);
8476
}
8577

8678
@Test
8779
public void sendErrorForRequestAcceptingJsonProducesAJsonResponse() throws Exception {
88-
assertThatPathProducesExpectedResponse("/bootapp/send-error",
89-
MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON);
80+
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.APPLICATION_JSON,
81+
MediaType.APPLICATION_JSON);
9082
}
9183

9284
@Test
93-
public void sendErrorForRequestAcceptingHtmlProducesAnHtmlResponse()
94-
throws Exception {
95-
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.TEXT_HTML,
96-
MediaType.TEXT_HTML);
85+
public void sendErrorForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception {
86+
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.TEXT_HTML, MediaType.TEXT_HTML);
9787
}
9888

99-
private void assertThatPathProducesExpectedResponse(String path, MediaType accept,
100-
MediaType contentType) {
101-
RequestEntity<Void> request = RequestEntity
102-
.get(URI.create("http://localhost:" + this.port + path)).accept(accept)
103-
.build();
89+
private void assertThatPathProducesExpectedResponse(String path, MediaType accept, MediaType contentType) {
90+
RequestEntity<Void> request = RequestEntity.get(URI.create("http://localhost:" + this.port + path))
91+
.accept(accept).build();
10492
ResponseEntity<String> response = this.rest.exchange(request, String.class);
10593
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
10694
assertThat(contentType.isCompatibleWith(response.getHeaders().getContentType()))
107-
.as("%s is compatible with %s", contentType,
108-
response.getHeaders().getContentType())
109-
.isTrue();
95+
.as("%s is compatible with %s", contentType, response.getHeaders().getContentType()).isTrue();
11096
}
11197

11298
}

spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,8 +34,7 @@ public class SampleTomEEDeployApplicationIT {
3434
@Test
3535
public void testHome() throws Exception {
3636
String url = "http://localhost:" + this.port + "/bootapp/";
37-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
38-
String.class);
37+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
3938
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
4039
assertThat(entity.getBody()).isEqualTo("Hello World");
4140
}
@@ -44,8 +43,7 @@ public void testHome() throws Exception {
4443
public void testHealth() throws Exception {
4544
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
4645
System.out.println(url);
47-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
48-
String.class);
46+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
4947
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
5048
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
5149
}

spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,8 +34,7 @@ public class SampleWildFlyDeployApplicationIT {
3434
@Test
3535
public void testHome() throws Exception {
3636
String url = "http://localhost:" + this.port + "/bootapp/";
37-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
38-
String.class);
37+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
3938
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
4039
assertThat(entity.getBody()).isEqualTo("Hello World");
4140
}
@@ -44,8 +43,7 @@ public void testHome() throws Exception {
4443
public void testHealth() throws Exception {
4544
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
4645
System.out.println(url);
47-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
48-
String.class);
46+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
4947
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
5048
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
5149
}

spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,8 +34,7 @@ public class SampleWlpDeployApplicationIT {
3434
@Test
3535
public void testHome() throws Exception {
3636
String url = "http://localhost:" + this.port + "/bootapp/";
37-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
38-
String.class);
37+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
3938
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
4039
assertThat(entity.getBody()).isEqualTo("Hello World");
4140
}
@@ -44,8 +43,7 @@ public void testHome() throws Exception {
4443
public void testHealth() throws Exception {
4544
String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
4645
System.out.println(url);
47-
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url,
48-
String.class);
46+
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
4947
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
5048
assertThat(entity.getBody()).isEqualTo("{\"status\":\"UP\"}");
5149
}

0 commit comments

Comments
 (0)