From f86f96a35e9723f8624961f273d0f8a32a694c03 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 3 Feb 2024 15:35:09 -0800 Subject: [PATCH] Test 100% --- .../main/java/com/wisemapping/config/rest/RestAppConfig.java | 2 +- wise-webapp/src/main/resources/application.properties | 2 +- .../com/wisemapping/test/rest/RestAccountControllerTest.java | 2 +- .../com/wisemapping/test/rest/RestLabelControllerTest.java | 2 +- .../com/wisemapping/test/rest/RestMindmapControllerTest.java | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/config/rest/RestAppConfig.java b/wise-webapp/src/main/java/com/wisemapping/config/rest/RestAppConfig.java index 3441dac4..39fe85ba 100644 --- a/wise-webapp/src/main/java/com/wisemapping/config/rest/RestAppConfig.java +++ b/wise-webapp/src/main/java/com/wisemapping/config/rest/RestAppConfig.java @@ -18,7 +18,7 @@ import static org.springframework.security.config.Customizer.withDefaults; @SpringBootApplication(scanBasePackageClasses = MindmapController.class) -@Import({ServletConfig.class, InterceptorsConfig.class}) +@Import({InterceptorsConfig.class}) @EnableWebSecurity public class RestAppConfig { @Bean diff --git a/wise-webapp/src/main/resources/application.properties b/wise-webapp/src/main/resources/application.properties index 69842795..eb6b13ec 100755 --- a/wise-webapp/src/main/resources/application.properties +++ b/wise-webapp/src/main/resources/application.properties @@ -12,7 +12,7 @@ spring.sql.init.mode=always spring.sql.init.platform=hsqldb # LOG -logging.level.root=TRACE +logging.level.root=INFO logging.level.org.apache.tomcat=INFO ################################################################################## diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountControllerTest.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountControllerTest.java index 1a577610..689187e5 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountControllerTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestAccountControllerTest.java @@ -38,7 +38,7 @@ import static com.wisemapping.test.rest.RestHelper.*; import static org.junit.jupiter.api.Assertions.assertEquals; -@SpringBootTest(classes = {RestAppConfig.class, CommonConfig.class, MindmapController.class, AdminController.class, UserController.class}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = {RestAppConfig.class, CommonConfig.class, MindmapController.class, AdminController.class, UserController.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class RestAccountControllerTest { private static final String ADMIN_USER = "admin@wisemapping.org"; private static final String ADMIN_PASSWORD = "test"; diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelControllerTest.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelControllerTest.java index 6114fd61..6740e10b 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelControllerTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestLabelControllerTest.java @@ -28,7 +28,7 @@ import static com.wisemapping.test.rest.RestHelper.createHeaders; import static org.junit.jupiter.api.Assertions.*; -@SpringBootTest(classes = {RestAppConfig.class, CommonConfig.class, LabelController.class, AdminController.class, UserController.class}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = {RestAppConfig.class, CommonConfig.class, LabelController.class, AdminController.class, UserController.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class RestLabelControllerTest { private static final String COLOR = "#000000"; diff --git a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapControllerTest.java b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapControllerTest.java index 075729c7..d26b3ebe 100644 --- a/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapControllerTest.java +++ b/wise-webapp/src/test/java/com/wisemapping/test/rest/RestMindmapControllerTest.java @@ -30,7 +30,7 @@ import java.util.stream.Collectors; import static com.wisemapping.test.rest.RestHelper.createHeaders; import static org.junit.jupiter.api.Assertions.*; -@SpringBootTest(classes = {RestAppConfig.class, CommonConfig.class, MindmapController.class, AdminController.class, UserController.class}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) +@SpringBootTest(classes = {RestAppConfig.class, CommonConfig.class, MindmapController.class, AdminController.class, UserController.class}, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) public class RestMindmapControllerTest { private RestUser user; @@ -791,7 +791,7 @@ public class RestMindmapControllerTest { private RestMindmap findMap(@NotNull HttpHeaders requestHeaders, @NotNull TestRestTemplate template, URI resourceUri) { final HttpEntity findMapEntity = new HttpEntity<>(requestHeaders); - final ResponseEntity response = template.exchange("http://localhost:8081/" + resourceUri.toString(), HttpMethod.GET, findMapEntity, RestMindmap.class); + final ResponseEntity response = template.exchange(resourceUri.toString(), HttpMethod.GET, findMapEntity, RestMindmap.class); if (!response.getStatusCode().is2xxSuccessful()) { throw new IllegalArgumentException(response.toString());