Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit a4f2df8

Browse files
authored
Fix java 8 compilation (#378)
1 parent 4420830 commit a4f2df8

File tree

1 file changed

+5
-3
lines changed
  • service/src/test/java/com/theokanning/openai/service

1 file changed

+5
-3
lines changed

service/src/test/java/com/theokanning/openai/service/FileTest.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
import org.junit.jupiter.api.TestMethodOrder;
99

1010
import java.io.IOException;
11+
import java.nio.charset.StandardCharsets;
1112
import java.nio.file.Files;
12-
import java.nio.file.Path;
13+
import java.nio.file.Paths;
1314
import java.util.List;
1415
import java.util.concurrent.TimeUnit;
1516

@@ -21,7 +22,7 @@ public class FileTest {
2122
static String filePath = "src/test/resources/fine-tuning-data.jsonl";
2223

2324
String token = System.getenv("OPENAI_TOKEN");
24-
com.theokanning.openai.service.OpenAiService service = new OpenAiService(token);
25+
OpenAiService service = new OpenAiService(token);
2526
static String fileId;
2627

2728
@Test
@@ -57,7 +58,8 @@ void retrieveFile() {
5758
@Order(4)
5859
void retrieveFileContent() throws IOException {
5960
String fileBytesToString = service.retrieveFileContent(fileId).string();
60-
assertEquals(Files.readString(Path.of(filePath)), fileBytesToString);
61+
String contents = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);
62+
assertEquals(contents, fileBytesToString);
6163
}
6264

6365
@Test

0 commit comments

Comments
 (0)