Commit 35dc7982 authored by Issam El-atif's avatar Issam El-atif Committed by Phillip Webb

Fix deployment tests JUnit 5 checkstyle issues

See gh-17106
parent c11f25bf
...@@ -32,7 +32,7 @@ public class SampleGlassfishDeployApplicationIT { ...@@ -32,7 +32,7 @@ public class SampleGlassfishDeployApplicationIT {
private int port = Integer.valueOf(System.getProperty("port")); private int port = Integer.valueOf(System.getProperty("port"));
@Test @Test
public void testHome() throws Exception { void testHome() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/"; String url = "http://localhost:" + this.port + "/bootapp/";
System.out.println(url); System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
...@@ -41,7 +41,7 @@ public class SampleGlassfishDeployApplicationIT { ...@@ -41,7 +41,7 @@ public class SampleGlassfishDeployApplicationIT {
} }
@Test @Test
public void testHealth() throws Exception { void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url); System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
......
...@@ -38,7 +38,7 @@ public class SampleTomcatDeployApplicationIT { ...@@ -38,7 +38,7 @@ public class SampleTomcatDeployApplicationIT {
private int port = Integer.valueOf(System.getProperty("port")); private int port = Integer.valueOf(System.getProperty("port"));
@Test @Test
public void testHome() throws Exception { void testHome() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/"; String url = "http://localhost:" + this.port + "/bootapp/";
ResponseEntity<String> entity = this.rest.getForEntity(url, String.class); ResponseEntity<String> entity = this.rest.getForEntity(url, String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
...@@ -46,7 +46,7 @@ public class SampleTomcatDeployApplicationIT { ...@@ -46,7 +46,7 @@ public class SampleTomcatDeployApplicationIT {
} }
@Test @Test
public void testHealth() throws Exception { void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url); System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
...@@ -55,34 +55,34 @@ public class SampleTomcatDeployApplicationIT { ...@@ -55,34 +55,34 @@ public class SampleTomcatDeployApplicationIT {
} }
@Test @Test
public void errorFromExceptionForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { void errorFromExceptionForRequestAcceptingAnythingProducesAJsonResponse() throws Exception {
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.ALL, MediaType.APPLICATION_JSON); assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.ALL, MediaType.APPLICATION_JSON);
} }
@Test @Test
public void errorFromExceptionForRequestAcceptingJsonProducesAJsonResponse() throws Exception { void errorFromExceptionForRequestAcceptingJsonProducesAJsonResponse() throws Exception {
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.APPLICATION_JSON, assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.APPLICATION_JSON,
MediaType.APPLICATION_JSON); MediaType.APPLICATION_JSON);
} }
@Test @Test
public void errorFromExceptionForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { void errorFromExceptionForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception {
assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.TEXT_HTML, MediaType.TEXT_HTML); assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.TEXT_HTML, MediaType.TEXT_HTML);
} }
@Test @Test
public void sendErrorForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { void sendErrorForRequestAcceptingAnythingProducesAJsonResponse() throws Exception {
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.ALL, MediaType.APPLICATION_JSON); assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.ALL, MediaType.APPLICATION_JSON);
} }
@Test @Test
public void sendErrorForRequestAcceptingJsonProducesAJsonResponse() throws Exception { void sendErrorForRequestAcceptingJsonProducesAJsonResponse() throws Exception {
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.APPLICATION_JSON, assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.APPLICATION_JSON,
MediaType.APPLICATION_JSON); MediaType.APPLICATION_JSON);
} }
@Test @Test
public void sendErrorForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { void sendErrorForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception {
assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.TEXT_HTML, MediaType.TEXT_HTML); assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.TEXT_HTML, MediaType.TEXT_HTML);
} }
......
...@@ -32,7 +32,7 @@ public class SampleTomEEDeployApplicationIT { ...@@ -32,7 +32,7 @@ public class SampleTomEEDeployApplicationIT {
private int port = Integer.valueOf(System.getProperty("port")); private int port = Integer.valueOf(System.getProperty("port"));
@Test @Test
public void testHome() throws Exception { void testHome() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/"; String url = "http://localhost:" + this.port + "/bootapp/";
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
...@@ -40,7 +40,7 @@ public class SampleTomEEDeployApplicationIT { ...@@ -40,7 +40,7 @@ public class SampleTomEEDeployApplicationIT {
} }
@Test @Test
public void testHealth() throws Exception { void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url); System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
......
...@@ -32,7 +32,7 @@ public class SampleWildFlyDeployApplicationIT { ...@@ -32,7 +32,7 @@ public class SampleWildFlyDeployApplicationIT {
private int port = Integer.valueOf(System.getProperty("port")); private int port = Integer.valueOf(System.getProperty("port"));
@Test @Test
public void testHome() throws Exception { void testHome() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/"; String url = "http://localhost:" + this.port + "/bootapp/";
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
...@@ -40,7 +40,7 @@ public class SampleWildFlyDeployApplicationIT { ...@@ -40,7 +40,7 @@ public class SampleWildFlyDeployApplicationIT {
} }
@Test @Test
public void testHealth() throws Exception { void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url); System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
......
...@@ -32,7 +32,7 @@ public class SampleWlpDeployApplicationIT { ...@@ -32,7 +32,7 @@ public class SampleWlpDeployApplicationIT {
private int port = Integer.valueOf(System.getProperty("port")); private int port = Integer.valueOf(System.getProperty("port"));
@Test @Test
public void testHome() throws Exception { void testHome() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/"; String url = "http://localhost:" + this.port + "/bootapp/";
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
...@@ -40,7 +40,7 @@ public class SampleWlpDeployApplicationIT { ...@@ -40,7 +40,7 @@ public class SampleWlpDeployApplicationIT {
} }
@Test @Test
public void testHealth() throws Exception { void testHealth() throws Exception {
String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; String url = "http://localhost:" + this.port + "/bootapp/actuator/health";
System.out.println(url); System.out.println(url);
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class); ResponseEntity<String> entity = new TestRestTemplate().getForEntity(url, String.class);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment