#BAEL-6916: add StandardCharsets

This commit is contained in:
hmdrzsharifi 2023-09-26 09:05:22 +03:30
parent b5c06059f0
commit 083cf15f77
2 changed files with 4 additions and 2 deletions

View File

@ -19,6 +19,7 @@ import org.springframework.test.annotation.DirtiesContext;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
@ -77,7 +78,7 @@ public class FruitArrayJacksonUnmarshalUnitTest {
private String readJsonFromFile(String path) throws URISyntaxException, IOException {
URL resource = FruitArrayJacksonUnmarshalUnitTest.class.getResource(path);
return new String(Files.readAllBytes(Paths.get(resource.toURI())));
return new String(Files.readAllBytes(Paths.get(resource.toURI())), StandardCharsets.UTF_8);
}
}

View File

@ -19,6 +19,7 @@ import org.springframework.context.annotation.Bean;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
@ -76,7 +77,7 @@ public class FruitListJacksonUnmarshalUnitTest {
private String readJsonFromFile(String path) throws URISyntaxException, IOException {
URL resource = FruitListJacksonUnmarshalUnitTest.class.getResource(path);
return new String(Files.readAllBytes(Paths.get(resource.toURI())));
return new String(Files.readAllBytes(Paths.get(resource.toURI())), StandardCharsets.UTF_8);
}
}