Skip to content

Commit 0101aad

Browse files
committed
✅ fixing error
1 parent 18717bf commit 0101aad

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/test/java/com/mindee/http/MindeeHttpApiTest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,25 @@ void givenError_withDetailNodeAsAnObject_mustThrowMindeeException()
6767
throws IOException {
6868

6969
String url = String.format("http://localhost:%s", mockWebServer.getPort());
70-
Path path = Paths.get("src/test/resources/data/errors/with_object_response_in_detail.json");
70+
Path path = Paths.get("src/test/resources/data/errors/complete_with_object_response_in_detail.json");
7171
mockWebServer.enqueue(new MockResponse()
7272
.setResponseCode(400)
7373
.setBody(new String(Files.readAllBytes(path))));
7474

7575
File file = new File("src/test/resources/data/invoice/invoice.pdf");
7676
MindeeHttpApi client = new MindeeHttpApi(new MindeeSettings("abc", url));
77+
byte[] fileInBytes = Files.readAllBytes(file.toPath());
78+
ParseParameter parseParameter =
79+
ParseParameter.builder()
80+
.file(fileInBytes)
81+
.fileName(file.getName())
82+
.build();
7783

7884
Assertions.assertThrows(
7985
MindeeException.class,
8086
() -> client.predict(
8187
InvoiceV4Inference.class,
82-
ParseParameter.builder()
83-
.file(Files.readAllBytes(file.toPath()))
84-
.fileName(file.getName())
85-
.build()));
88+
parseParameter)
89+
);
8690
}
8791
}

0 commit comments

Comments
 (0)