From 35dc7982d28800b4fecdf0772236a2d8e054aa77 Mon Sep 17 00:00:00 2001 From: Issam El-atif Date: Tue, 11 Jun 2019 14:58:10 +0200 Subject: [PATCH] Fix deployment tests JUnit 5 checkstyle issues See gh-17106 --- .../SampleGlassfishDeployApplicationIT.java | 4 ++-- .../sample/SampleTomcatDeployApplicationIT.java | 16 ++++++++-------- .../sample/SampleTomEEDeployApplicationIT.java | 4 ++-- .../sample/SampleWildFlyDeployApplicationIT.java | 4 ++-- .../sample/SampleWlpDeployApplicationIT.java | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java index ed2949f1ae4..491b5d505aa 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java +++ b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-glassfish/src/test/java/sample/SampleGlassfishDeployApplicationIT.java @@ -32,7 +32,7 @@ public class SampleGlassfishDeployApplicationIT { private int port = Integer.valueOf(System.getProperty("port")); @Test - public void testHome() throws Exception { + void testHome() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/"; System.out.println(url); ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); @@ -41,7 +41,7 @@ public class SampleGlassfishDeployApplicationIT { } @Test - public void testHealth() throws Exception { + void testHealth() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; System.out.println(url); ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java index 069ffd3d3ae..a4c9f144105 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java +++ b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomcat/src/test/java/sample/SampleTomcatDeployApplicationIT.java @@ -38,7 +38,7 @@ public class SampleTomcatDeployApplicationIT { private int port = Integer.valueOf(System.getProperty("port")); @Test - public void testHome() throws Exception { + void testHome() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/"; ResponseEntity entity = this.rest.getForEntity(url, String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); @@ -46,7 +46,7 @@ public class SampleTomcatDeployApplicationIT { } @Test - public void testHealth() throws Exception { + void testHealth() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; System.out.println(url); ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); @@ -55,34 +55,34 @@ public class SampleTomcatDeployApplicationIT { } @Test - public void errorFromExceptionForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { + void errorFromExceptionForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.ALL, MediaType.APPLICATION_JSON); } @Test - public void errorFromExceptionForRequestAcceptingJsonProducesAJsonResponse() throws Exception { + void errorFromExceptionForRequestAcceptingJsonProducesAJsonResponse() throws Exception { assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON); } @Test - public void errorFromExceptionForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { + void errorFromExceptionForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { assertThatPathProducesExpectedResponse("/bootapp/exception", MediaType.TEXT_HTML, MediaType.TEXT_HTML); } @Test - public void sendErrorForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { + void sendErrorForRequestAcceptingAnythingProducesAJsonResponse() throws Exception { assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.ALL, MediaType.APPLICATION_JSON); } @Test - public void sendErrorForRequestAcceptingJsonProducesAJsonResponse() throws Exception { + void sendErrorForRequestAcceptingJsonProducesAJsonResponse() throws Exception { assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.APPLICATION_JSON, MediaType.APPLICATION_JSON); } @Test - public void sendErrorForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { + void sendErrorForRequestAcceptingHtmlProducesAnHtmlResponse() throws Exception { assertThatPathProducesExpectedResponse("/bootapp/send-error", MediaType.TEXT_HTML, MediaType.TEXT_HTML); } diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java index dfc5061a5ef..cb9acd56c6e 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java +++ b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-tomee/src/test/java/sample/SampleTomEEDeployApplicationIT.java @@ -32,7 +32,7 @@ public class SampleTomEEDeployApplicationIT { private int port = Integer.valueOf(System.getProperty("port")); @Test - public void testHome() throws Exception { + void testHome() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/"; ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); @@ -40,7 +40,7 @@ public class SampleTomEEDeployApplicationIT { } @Test - public void testHealth() throws Exception { + void testHealth() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; System.out.println(url); ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java index af7a3fa9f22..001ffe6f5bb 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java +++ b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wildfly/src/test/java/sample/SampleWildFlyDeployApplicationIT.java @@ -32,7 +32,7 @@ public class SampleWildFlyDeployApplicationIT { private int port = Integer.valueOf(System.getProperty("port")); @Test - public void testHome() throws Exception { + void testHome() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/"; ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); @@ -40,7 +40,7 @@ public class SampleWildFlyDeployApplicationIT { } @Test - public void testHealth() throws Exception { + void testHealth() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; System.out.println(url); ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); diff --git a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java index 3fbeac500f7..64b2ca48476 100644 --- a/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java +++ b/spring-boot-tests/spring-boot-deployment-tests/spring-boot-deployment-test-wlp/src/test/java/sample/SampleWlpDeployApplicationIT.java @@ -32,7 +32,7 @@ public class SampleWlpDeployApplicationIT { private int port = Integer.valueOf(System.getProperty("port")); @Test - public void testHome() throws Exception { + void testHome() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/"; ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class); assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK); @@ -40,7 +40,7 @@ public class SampleWlpDeployApplicationIT { } @Test - public void testHealth() throws Exception { + void testHealth() throws Exception { String url = "http://localhost:" + this.port + "/bootapp/actuator/health"; System.out.println(url); ResponseEntity entity = new TestRestTemplate().getForEntity(url, String.class);