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

Commit

Permalink
Fix java 8 compilation (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoKanning authored Oct 22, 2023
1 parent 4420830 commit a4f2df8
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a4f2df8

Please sign in to comment.