This repository was archived by the owner on Jun 6, 2024. It is now read-only.
File tree 1 file changed +5
-3
lines changed
service/src/test/java/com/theokanning/openai/service
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 8
8
import org .junit .jupiter .api .TestMethodOrder ;
9
9
10
10
import java .io .IOException ;
11
+ import java .nio .charset .StandardCharsets ;
11
12
import java .nio .file .Files ;
12
- import java .nio .file .Path ;
13
+ import java .nio .file .Paths ;
13
14
import java .util .List ;
14
15
import java .util .concurrent .TimeUnit ;
15
16
@@ -21,7 +22,7 @@ public class FileTest {
21
22
static String filePath = "src/test/resources/fine-tuning-data.jsonl" ;
22
23
23
24
String token = System .getenv ("OPENAI_TOKEN" );
24
- com . theokanning . openai . service . OpenAiService service = new OpenAiService (token );
25
+ OpenAiService service = new OpenAiService (token );
25
26
static String fileId ;
26
27
27
28
@ Test
@@ -57,7 +58,8 @@ void retrieveFile() {
57
58
@ Order (4 )
58
59
void retrieveFileContent () throws IOException {
59
60
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 );
61
63
}
62
64
63
65
@ Test
You can’t perform that action at this time.
0 commit comments