Test 100%

This commit is contained in:
Paulo Gustavo Veiga 2024-02-03 15:35:09 -08:00
parent e28302236b
commit f86f96a35e
5 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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
##################################################################################

View File

@ -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";

View File

@ -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";

View File

@ -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<RestMindmap> findMapEntity = new HttpEntity<>(requestHeaders);
final ResponseEntity<RestMindmap> response = template.exchange("http://localhost:8081/" + resourceUri.toString(), HttpMethod.GET, findMapEntity, RestMindmap.class);
final ResponseEntity<RestMindmap> response = template.exchange(resourceUri.toString(), HttpMethod.GET, findMapEntity, RestMindmap.class);
if (!response.getStatusCode().is2xxSuccessful()) {
throw new IllegalArgumentException(response.toString());