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

Fix java 8 compilation #378

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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