Support for Java 11

This commit is contained in:
Paulo Gustavo Veiga
2020-11-06 21:35:54 -08:00
parent 6872cda952
commit 9b738eaaf7
45 changed files with 240 additions and 232 deletions

View File

@@ -22,18 +22,22 @@ public class ExportXsltBasedTest {
@Test(dataProvider = "Data-Provider-Function")
public void exportImportExportTest(@NotNull XSLTExporter.Type type, @NotNull final File wisemap, @NotNull final File recFile) throws ImporterException, IOException, ExportException {
public void exportImportExportTest(@NotNull XSLTExporter.Type type, @NotNull final File wisemap, @NotNull final File recFile) throws IOException, ExportException {
final Exporter exporter = XSLTExporter.create(type);
byte[] wiseMapContent = FileUtils.readFileToByteArray(wisemap);
if (recFile.exists()) {
// Compare rec and file ...
final String recContent = FileUtils.readFileToString(recFile, ENC_UTF_8);
final String recContent = FileUtils.readFileToString(recFile, ENC_UTF_8)
.replaceAll("\n\\p{Blank}+", "\n")
.replaceAll("\n+", "\n");
// Export mile content ...
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
exporter.export(wiseMapContent, bos);
final String exportContent = new String(bos.toByteArray(), StandardCharsets.UTF_8);
final String exportContent = new String(bos.toByteArray(), StandardCharsets.UTF_8)
.replaceAll("\n\\p{Blank}+", "\n")
.replaceAll("\n+", "\n");
Assert.assertEquals(exportContent, recContent);
} else {

View File

@@ -1,8 +1,8 @@
package com.wisemapping.test.model;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.wisemapping.rest.model.*;
import org.codehaus.jackson.map.ObjectMapper;
import org.testng.annotations.Test;
import java.io.IOException;

View File

@@ -97,12 +97,12 @@ public class RestAccountITCase {
HttpEntity<RestUser> findUserEntity = new HttpEntity<RestUser>(requestHeaders);
// Add extension only to avoid the fact that the last part is extracted ...
final String url = BASE_REST_URL + "/admin/users/email/{email}.json";
final String url = BASE_REST_URL + "/admin/users/email/{email}";
return templateRest.exchange(url, HttpMethod.GET, findUserEntity, RestUser.class, email);
}
private URI createUser(HttpHeaders requestHeaders, RestTemplate templateRest, RestUser restUser) {
HttpEntity<RestUser> createUserEntity = new HttpEntity<RestUser>(restUser, requestHeaders);
HttpEntity<RestUser> createUserEntity = new HttpEntity< >(restUser, requestHeaders);
return templateRest.postForLocation(BASE_REST_URL + "/admin/users", createUserEntity);
}

View File

@@ -125,10 +125,10 @@ public class RestAdminITCase {
}
private ResponseEntity<RestUser> findUserByEmail(HttpHeaders requestHeaders, RestTemplate templateRest, final String email) {
HttpEntity<RestUser> findUserEntity = new HttpEntity<RestUser>(requestHeaders);
HttpEntity<RestUser> findUserEntity = new HttpEntity<>(requestHeaders);
// Add extension only to avoid the fact that the last part is extracted ...
final String url = BASE_REST_URL + "/admin/users/email/{email}.json";
final String url = BASE_REST_URL + "/admin/users/email/{email}?mediaType=json";
return templateRest.exchange(url, HttpMethod.GET, findUserEntity, RestUser.class, email);
}

View File

@@ -2,21 +2,10 @@ package com.wisemapping.test.rest;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.model.Label;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestLabel;
import com.wisemapping.rest.model.RestLabelList;
import com.wisemapping.rest.model.RestMindmap;
import com.wisemapping.rest.model.RestMindmapInfo;
import com.wisemapping.rest.model.RestMindmapList;
import com.wisemapping.rest.model.RestUser;
import com.wisemapping.rest.model.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.*;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
import org.testng.SkipException;
@@ -27,14 +16,8 @@ import java.io.IOException;
import java.net.URI;
import java.util.List;
import static com.wisemapping.test.rest.RestHelper.BASE_REST_URL;
import static com.wisemapping.test.rest.RestHelper.COLOR;
import static com.wisemapping.test.rest.RestHelper.HOST_PORT;
import static com.wisemapping.test.rest.RestHelper.createHeaders;
import static com.wisemapping.test.rest.RestHelper.createTemplate;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import static com.wisemapping.test.rest.RestHelper.*;
import static org.testng.Assert.*;
@Test
public class RestMindmapITCase {