Skip to content

Commit 303aa71

Browse files
committed
✅ functional test all supported APIs
1 parent 8e245f5 commit 303aa71

15 files changed

+196
-199
lines changed

.github/workflows/test-sample-codes.yml renamed to .github/workflows/test-code-samples.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
name: Test Code Samples
1+
name: Test Samples Java Classes
22
on:
33
pull_request:
44
schedule:
55
- cron: '0 23 * * *'
6-
# Allow running this workflow manually from the Actions tab
7-
workflow_dispatch:
86

7+
# Allows to run this workflow manually from the Actions tab
8+
workflow_dispatch:
99
jobs:
1010
build:
1111
name: Run Tests
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
1515
java-version:
16-
- "8"
1716
- "11"
17+
- "8"
1818
distribution:
1919
- "temurin"
2020

.github/workflows/test-sample-codes-java.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
String apiKey = "my-api-key";
2-
String filePath = "/path/to/the/file.ext";
1+
import com.mindee.MindeeClient;
2+
import com.mindee.MindeeClientInit;
3+
import com.mindee.DocumentToParse;
4+
import com.mindee.parsing.common.Document;
5+
import com.mindee.parsing.us.bankcheck.BankCheckV1Inference;
6+
import java.io.File;
7+
import java.io.IOException;
38

4-
int code = 1;
5-
{
6-
com.mindee.MindeeClient mindeeClient = com.mindee.MindeeClientInit.create(apiKey);
7-
com.mindee.DocumentToParse docToParse = new com.mindee.DocumentToParse(new File(filePath));
9+
public class SimpleMindeeClient {
810

9-
com.mindee.parsing.common.Document<com.mindee.parsing.us.bankcheck.BankCheckV1Inference> documentParsed =
10-
mindeeClient.parse(com.mindee.parsing.us.bankcheck.BankCheckV1Inference.class,docToParse);
11+
public static void main(String[] args) throws IOException {
12+
String apiKey = "my-api-key";
13+
String filePath = "/path/to/the/file.ext";
1114

12-
System.out.println(documentParsed.toString());
15+
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
16+
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
1317

14-
code = 0;
15-
}
16-
/exit code
18+
Document<BankCheckV1Inference> documentParsed = mindeeClient.parse(BankCheckV1Inference.class, docToParse);
19+
20+
System.out.println(documentParsed.toString());
21+
}
1722

23+
}

docs/code_samples/carte_vitale_v1.txt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
String apiKey = "my-api-key";
2-
String filePath = "/path/to/the/file.ext";
3-
int code = 1;
4-
{
5-
com.mindee.MindeeClient mindeeClient = com.mindee.MindeeClientInit.create(apiKey);
6-
com.mindee.DocumentToParse docToParse = new com.mindee.DocumentToParse(new File(filePath));
1+
import com.mindee.MindeeClient;
2+
import com.mindee.MindeeClientInit;
3+
import com.mindee.DocumentToParse;
4+
import com.mindee.parsing.common.Document;
5+
import com.mindee.parsing.fr.cartevitale.CarteVitaleV1Inference;
6+
import java.io.File;
7+
import java.io.IOException;
78

8-
com.mindee.parsing.common.Document<com.mindee.parsing.fr.cartevitale.CarteVitaleV1Inference> documentParsed = mindeeClient.parse(com.mindee.parsing.fr.cartevitale.CarteVitaleV1Inference.class,docToParse);
9+
public class SimpleMindeeClient {
10+
11+
public static void main(String[] args) throws IOException {
12+
String apiKey = "my-api-key";
13+
String filePath = "/path/to/the/file.ext";
14+
15+
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
16+
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
17+
18+
Document<CarteVitaleV1Inference> documentParsed = mindeeClient.parse(CarteVitaleV1Inference.class, docToParse);
19+
20+
System.out.println(documentParsed.toString());
21+
}
922

10-
System.out.println(documentParsed.toString());
11-
code = 0;
1223
}
13-
/exit code

docs/code_samples/custom_v1.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class SimpleMindeeClient {
1616
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
1717
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
1818

19-
CustomEndpoint customEndpoint = new CustomEndpoint("my-endpoint","my-account");
20-
Document<CustomV1Inference> documentParsed = mindeeClient.parse(docToParse,customEndpoint);
19+
CustomEndpoint customEndpoint = new CustomEndpoint("my-endpoint", "my-account");
20+
Document<CustomV1Inference> documentParsed = mindeeClient.parse(docToParse, customEndpoint);
2121

2222
System.out.println(documentParsed.toString());
2323
}

docs/code_samples/expense_receipts_v4.txt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
String apiKey = "my-api-key";
2-
String filePath = "/path/to/the/file.ext";
3-
int code = 1;
4-
{
5-
com.mindee.MindeeClient mindeeClient = com.mindee.MindeeClientInit.create(apiKey);
6-
com.mindee.DocumentToParse docToParse = new com.mindee.DocumentToParse(new File(filePath));
1+
import com.mindee.MindeeClient;
2+
import com.mindee.MindeeClientInit;
3+
import com.mindee.DocumentToParse;
4+
import com.mindee.parsing.common.Document;
5+
import com.mindee.parsing.receipt.ReceiptV4Inference;
6+
import java.io.File;
7+
import java.io.IOException;
78

8-
com.mindee.parsing.common.Document<com.mindee.parsing.receipt.ReceiptV4Inference> documentParsed = mindeeClient.parse(com.mindee.parsing.receipt.ReceiptV4Inference.class,docToParse);
9+
public class SimpleMindeeClient {
10+
11+
public static void main(String[] args) throws IOException {
12+
String apiKey = "my-api-key";
13+
String filePath = "/path/to/the/file.ext";
14+
15+
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
16+
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
17+
18+
Document<ReceiptV4Inference> documentParsed = mindeeClient.parse(ReceiptV4Inference.class, docToParse);
19+
20+
System.out.println(documentParsed.toString());
21+
}
922

10-
System.out.println(documentParsed.toString());
11-
code = 0;
1223
}
13-
/exit code

docs/code_samples/financial_document_v1.txt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
String apiKey = "my-api-key";
2-
String filePath = "/path/to/the/file.ext";
3-
int code = 1;
4-
{
5-
com.mindee.MindeeClient mindeeClient = com.mindee.MindeeClientInit.create(apiKey);
6-
com.mindee.DocumentToParse docToParse = new com.mindee.DocumentToParse(new File(filePath));
1+
import com.mindee.MindeeClient;
2+
import com.mindee.MindeeClientInit;
3+
import com.mindee.DocumentToParse;
4+
import com.mindee.parsing.common.Document;
5+
import com.mindee.parsing.financial.FinancialV1Inference;
6+
import java.io.File;
7+
import java.io.IOException;
78

8-
com.mindee.parsing.common.Document<com.mindee.parsing.financial.FinancialV1Inference> documentParsed = mindeeClient.parse(com.mindee.parsing.financial.FinancialV1Inference.class,docToParse);
9+
public class SimpleMindeeClient {
10+
11+
public static void main(String[] args) throws IOException {
12+
String apiKey = "my-api-key";
13+
String filePath = "/path/to/the/file.ext";
14+
15+
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
16+
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
17+
18+
Document<FinancialV1Inference> documentParsed = mindeeClient.parse(FinancialV1Inference.class, docToParse);
19+
20+
System.out.println(documentParsed.toString());
21+
}
922

10-
System.out.println(documentParsed.toString());
11-
code = 0;
1223
}
13-
/exit code

docs/code_samples/idcard_fr_v1.txt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
String apiKey = "my-api-key";
2-
String filePath = "/path/to/the/file.ext";
3-
int code = 1;
4-
{
5-
com.mindee.MindeeClient mindeeClient = com.mindee.MindeeClientInit.create(apiKey);
6-
com.mindee.DocumentToParse docToParse = new com.mindee.DocumentToParse(new File(filePath));
1+
import com.mindee.MindeeClient;
2+
import com.mindee.MindeeClientInit;
3+
import com.mindee.DocumentToParse;
4+
import com.mindee.parsing.common.Document;
5+
import com.mindee.parsing.fr.idcard.IdCardV1Inference;
6+
import java.io.File;
7+
import java.io.IOException;
78

8-
com.mindee.parsing.common.Document<com.mindee.parsing.fr.idcard.IdCardV1Inference> documentParsed = mindeeClient.parse(com.mindee.parsing.fr.idcard.IdCardV1Inference.class,docToParse);
9+
public class SimpleMindeeClient {
10+
11+
public static void main(String[] args) throws IOException {
12+
String apiKey = "my-api-key";
13+
String filePath = "/path/to/the/file.ext";
14+
15+
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
16+
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
17+
18+
Document<IdCardV1Inference> documentParsed = mindeeClient.parse(IdCardV1Inference.class, docToParse);
19+
20+
System.out.println(documentParsed.toString());
21+
}
922

10-
System.out.println(documentParsed.toString());
11-
code = 0;
1223
}
13-
/exit code

docs/code_samples/invoices_v4.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
1616
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
1717

18-
Document<InvoiceV4Inference> documentParsed = mindeeClient.parse(InvoiceV4Inference.class,docToParse);
18+
Document<InvoiceV4Inference> documentParsed = mindeeClient.parse(InvoiceV4Inference.class, docToParse);
1919

2020
System.out.println(documentParsed.toString());
2121
}

docs/code_samples/license_plates_v1.txt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
String apiKey = "my-api-key";
2-
String filePath = "/path/to/the/file.ext";
3-
int code = 1;
4-
{
5-
com.mindee.MindeeClient mindeeClient = com.mindee.MindeeClientInit.create(apiKey);
6-
com.mindee.DocumentToParse docToParse = new com.mindee.DocumentToParse(new File(filePath));
1+
import com.mindee.MindeeClient;
2+
import com.mindee.MindeeClientInit;
3+
import com.mindee.DocumentToParse;
4+
import com.mindee.parsing.common.Document;
5+
import com.mindee.parsing.eu.licenseplate.LicensePlateV1Inference;
6+
import java.io.File;
7+
import java.io.IOException;
78

8-
com.mindee.parsing.common.Document<com.mindee.parsing.eu.licenseplate.LicensePlateV1Inference> documentParsed = mindeeClient.parse(com.mindee.parsing.eu.licenseplate.LicensePlateV1Inference.class,docToParse);
9+
public class SimpleMindeeClient {
10+
11+
public static void main(String[] args) throws IOException {
12+
String apiKey = "my-api-key";
13+
String filePath = "/path/to/the/file.ext";
14+
15+
MindeeClient mindeeClient = MindeeClientInit.create(apiKey);
16+
DocumentToParse docToParse = new DocumentToParse(new File(filePath));
17+
18+
Document<LicensePlateV1Inference> documentParsed = mindeeClient.parse(LicensePlateV1Inference.class, docToParse);
19+
20+
System.out.println(documentParsed.toString());
21+
}
922

10-
System.out.println(documentParsed.toString());
11-
code = 0;
1223
}
13-
/exit code

0 commit comments

Comments
 (0)