diff --git a/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildFirstCtxControllerTests.java b/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildFirstCtxControllerTests.java index 9a820fa..ab587c0 100644 --- a/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildFirstCtxControllerTests.java +++ b/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildFirstCtxControllerTests.java @@ -34,7 +34,7 @@ class ChildFirstCtxControllerTests extends ParentCtxDefinition { @Test void testChildFirst() throws Exception { - Map response = restTemplate.getForObject("/", Map.class); + Map response = this.restTemplate.getForObject("/", Map.class); Assertions.assertAll("Response from the first child context is wrong!", () -> Assertions.assertEquals("parent_bean", response.get("parentBean")), @@ -50,7 +50,7 @@ void testChildFirst() throws Exception { @Test void testChildFirstNotExists() throws Exception { - Map response = restTemplate.getForObject("/dummy", Map.class); + Map response = this.restTemplate.getForObject("/dummy", Map.class); Assertions.assertAll("Error response for non-existing URL on the first child context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), @@ -63,7 +63,7 @@ void testChildFirstNotExists() throws Exception { @Test void testChildFirstActuator() throws Exception { - Map response = restTemplate.getForObject("/actuator/beans", Map.class); + Map response = this.restTemplate.getForObject("/actuator/beans", Map.class); Assertions.assertNotNull(response.get("contexts"), "Actuator response is wrong!"); } diff --git a/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildSecondCtxControllerTests.java b/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildSecondCtxControllerTests.java index 5709f03..de4d3ff 100644 --- a/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildSecondCtxControllerTests.java +++ b/multi-ctx-app-builder/src/test/java/com/alex/demo/ctx/ChildSecondCtxControllerTests.java @@ -34,7 +34,7 @@ class ChildSecondCtxControllerTests extends ParentCtxDefinition { @Test void testChildSecond() throws Exception { - Map response = restTemplate.getForObject("/", Map.class); + Map response = this.restTemplate.getForObject("/", Map.class); Assertions.assertAll("Response from the second child context is wrong!", () -> Assertions.assertEquals("parent_bean", response.get("parentBean")), @@ -50,7 +50,7 @@ void testChildSecond() throws Exception { @Test void testChildSecondNotExists() throws Exception { - Map response = restTemplate.getForObject("/dummy", Map.class); + Map response = this.restTemplate.getForObject("/dummy", Map.class); Assertions.assertAll("Error response for non-existing URL on the second child context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), @@ -63,7 +63,7 @@ void testChildSecondNotExists() throws Exception { @Test void testChildSecondActuator() throws Exception { - Map response = restTemplate.getForObject("/actuator/beans", Map.class); + Map response = this.restTemplate.getForObject("/actuator/beans", Map.class); Assertions.assertNotNull(response.get("contexts"), "Actuator response is wrong!"); } diff --git a/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/CommonTest.java b/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/CommonTest.java index ee0df96..8efd623 100644 --- a/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/CommonTest.java +++ b/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/CommonTest.java @@ -30,14 +30,14 @@ abstract class CommonTest { @Test void testActuator() throws Exception { - Map response = restTemplate.getForObject("http://localhost:{actuatorPort}/actuator/beans", Map.class, this.actuatorPort); + Map response = this.restTemplate.getForObject("http://localhost:{actuatorPort}/actuator/beans", Map.class, this.actuatorPort); Assertions.assertNotNull(response.get("contexts"), "Actuator response is wrong!"); } int getChildPort() { - AnnotationConfigServletWebServerApplicationContext childContext = applicationContext + AnnotationConfigServletWebServerApplicationContext childContext = this.applicationContext .getBean(AnnotationConfigServletWebServerApplicationContext.class); return childContext.getWebServer().getPort(); } diff --git a/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java b/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java index 2971e9b..267b64d 100644 --- a/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java +++ b/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java @@ -11,7 +11,7 @@ class MultiCtxControllerTests extends CommonTest { @Test void testChild() throws Exception { - Map response = restTemplate.getForObject("http://localhost:{childPort}/child", Map.class, getChildPort()); + Map response = this.restTemplate.getForObject("http://localhost:{childPort}/child", Map.class, getChildPort()); Assertions.assertAll("Response from child context is wrong!", () -> Assertions.assertNull(response.get("parentBean")), @@ -25,7 +25,7 @@ void testChild() throws Exception { @Test void testChildNotExists() throws Exception { - Map response = restTemplate.getForObject("http://localhost:{childPort}/child/dummy", Map.class, getChildPort()); + Map response = this.restTemplate.getForObject("http://localhost:{childPort}/child/dummy", Map.class, getChildPort()); Assertions.assertAll("Error response for non-existing URL on child context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), @@ -38,7 +38,7 @@ void testChildNotExists() throws Exception { @Test void testParent() throws Exception { - Map response = restTemplate.getForObject("/parent", Map.class); + Map response = this.restTemplate.getForObject("/parent", Map.class); Assertions.assertAll("Response from parent context is wrong!", () -> Assertions.assertEquals("parent_bean", response.get("parentBean")), @@ -52,7 +52,7 @@ void testParent() throws Exception { @Test void testParentNotExists() throws Exception { - Map response = restTemplate.getForObject("/parent/dummy", Map.class); + Map response = this.restTemplate.getForObject("/parent/dummy", Map.class); Assertions.assertAll("Error response for non-existing URL on parent context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), diff --git a/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxWithParentProfileControllerTests.java b/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxWithParentProfileControllerTests.java index 9316021..af710a2 100644 --- a/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxWithParentProfileControllerTests.java +++ b/multi-ctx-app-embed/src/test/java/com/alex/demo/ctx/parent/MultiCtxWithParentProfileControllerTests.java @@ -13,7 +13,7 @@ class MultiCtxWithParentProfileControllerTests extends CommonTest { @Test void testChildWithParent() throws Exception { - Map response = restTemplate.getForObject("http://localhost:{childPort}/child", Map.class, + Map response = this.restTemplate.getForObject("http://localhost:{childPort}/child", Map.class, getChildPort()); Assertions.assertAll("Response from child context is wrong!", @@ -28,7 +28,7 @@ void testChildWithParent() throws Exception { @Test void testChildNotExists() throws Exception { - Map response = restTemplate.getForObject("http://localhost:{childPort}/child/dummy", Map.class, + Map response = this.restTemplate.getForObject("http://localhost:{childPort}/child/dummy", Map.class, getChildPort()); Assertions.assertAll("Error response for non-existing URL on child context is wrong!", @@ -42,7 +42,7 @@ void testChildNotExists() throws Exception { @Test void testParent() throws Exception { - Map response = restTemplate.getForObject("/parent", Map.class); + Map response = this.restTemplate.getForObject("/parent", Map.class); Assertions.assertAll("Response from parent context is wrong!", () -> Assertions.assertEquals("parent_bean", response.get("parentBean")), @@ -56,7 +56,7 @@ void testParent() throws Exception { @Test void testParentNotExists() throws Exception { - Map response = restTemplate.getForObject("/parent/dummy", Map.class); + Map response = this.restTemplate.getForObject("/parent/dummy", Map.class); Assertions.assertAll("Error response for non-existing URL on parent context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), diff --git a/multi-ctx-app-servlets/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java b/multi-ctx-app-servlets/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java index 27d89ed..4054a2f 100644 --- a/multi-ctx-app-servlets/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java +++ b/multi-ctx-app-servlets/src/test/java/com/alex/demo/ctx/parent/MultiCtxControllerTests.java @@ -19,7 +19,7 @@ class MultiCtxControllerTests { @Test void testParent() throws Exception { - Map response = restTemplate.getForObject("/", Map.class); + Map response = this.restTemplate.getForObject("/", Map.class); Assertions.assertAll("Response from parent context is wrong!", () -> Assertions.assertEquals("parent_bean", response.get("parentBean")), @@ -35,7 +35,7 @@ void testParent() throws Exception { @Test void testParentNotExists() throws Exception { - Map response = restTemplate.getForObject("/dummy", Map.class); + Map response = this.restTemplate.getForObject("/dummy", Map.class); Assertions.assertAll("Error response for non-existing URL on parent context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), @@ -54,7 +54,7 @@ void testParentActuator() throws Exception { @Test void testChildFirst() throws Exception { - Map response = restTemplate.getForObject("/first/", Map.class); + Map response = this.restTemplate.getForObject("/first/", Map.class); Assertions.assertAll("Response from the first child context is wrong!", () -> Assertions.assertEquals("parent_bean", response.get("parentBean")), @@ -70,7 +70,7 @@ void testChildFirst() throws Exception { @Test void testChildFirstNotExists() throws Exception { - Map response = restTemplate.getForObject("/first/dummy", Map.class); + Map response = this.restTemplate.getForObject("/first/dummy", Map.class); Assertions.assertAll("Error response for non-existing URL on the first child context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), @@ -89,7 +89,7 @@ void testChildFirstActuator() throws Exception { @Test void testChildSecond() throws Exception { - Map response = restTemplate.getForObject("/second/", Map.class); + Map response = this.restTemplate.getForObject("/second/", Map.class); Assertions.assertAll("Response from the second child context is wrong!", () -> Assertions.assertEquals("parent_bean", response.get("parentBean")), @@ -105,7 +105,7 @@ void testChildSecond() throws Exception { @Test void testChildSecondNotExists() throws Exception { - Map response = restTemplate.getForObject("/second/dummy", Map.class); + Map response = this.restTemplate.getForObject("/second/dummy", Map.class); Assertions.assertAll("Error response for non-existing URL on the second child context is wrong!", () -> Assertions.assertEquals("Not Found", response.get("error")), @@ -123,7 +123,7 @@ void testChildSecondActuator() throws Exception { @SuppressWarnings("unchecked") void testActuator(String URL, String message) throws Exception { - Map response = restTemplate.getForObject(URL, Map.class); + Map response = this.restTemplate.getForObject(URL, Map.class); Assertions.assertNotNull(response.get("contexts"), message); }