diff --git a/service/src/test/java/com/theokanning/openai/service/FileTest.java b/service/src/test/java/com/theokanning/openai/service/FileTest.java index 74fe2084..51dd9407 100644 --- a/service/src/test/java/com/theokanning/openai/service/FileTest.java +++ b/service/src/test/java/com/theokanning/openai/service/FileTest.java @@ -8,8 +8,9 @@ import org.junit.jupiter.api.TestMethodOrder; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; -import java.nio.file.Path; +import java.nio.file.Paths; import java.util.List; import java.util.concurrent.TimeUnit; @@ -21,7 +22,7 @@ public class FileTest { static String filePath = "src/test/resources/fine-tuning-data.jsonl"; String token = System.getenv("OPENAI_TOKEN"); - com.theokanning.openai.service.OpenAiService service = new OpenAiService(token); + OpenAiService service = new OpenAiService(token); static String fileId; @Test @@ -57,7 +58,8 @@ void retrieveFile() { @Order(4) void retrieveFileContent() throws IOException { String fileBytesToString = service.retrieveFileContent(fileId).string(); - assertEquals(Files.readString(Path.of(filePath)), fileBytesToString); + String contents = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8); + assertEquals(contents, fileBytesToString); } @Test