Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4f2df8

Browse filesBrowse files
authored
Fix java 8 compilation (TheoKanning#378)
1 parent 4420830 commit a4f2df8
Copy full SHA for a4f2df8

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
  • service/src/test/java/com/theokanning/openai/service
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

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

Copy file name to clipboardExpand all lines: service/src/test/java/com/theokanning/openai/service/FileTest.java
+5-3Lines changed: 5 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.