Skip to content

Commit 11fa1fe

Browse files
committed
♻️ automated batch update
1 parent 2a3f8d2 commit 11fa1fe

33 files changed

+109
-337
lines changed

.github/PULL_REQUEST_TEMPLATE.md

-12
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@
33
<!--- Why is this change required? What problem does it solve? -->
44

55

6-
## Related Issue
7-
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
8-
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
9-
<!--- Please link to the issue here: -->
10-
11-
12-
## How Has This Been Tested
13-
<!--- Please describe in detail how you tested your changes. -->
14-
<!--- Include details of your testing environment, and the tests you ran to -->
15-
<!--- see how your change affects other areas of the code, etc. -->
16-
17-
186
## Types of changes
197
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
208

docs/code_samples/bank_account_details_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<BankAccountDetailsV1> response = mindeeClient.parse(

docs/code_samples/bank_account_details_v2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<BankAccountDetailsV2> response = mindeeClient.parse(

docs/code_samples/bank_check_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<BankCheckV1> response = mindeeClient.parse(

docs/code_samples/barcode_reader_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<BarcodeReaderV1> response = mindeeClient.parse(

docs/code_samples/carte_grise_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<CarteGriseV1> response = mindeeClient.parse(

docs/code_samples/carte_vitale_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<CarteVitaleV1> response = mindeeClient.parse(

docs/code_samples/cropper_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<CropperV1> response = mindeeClient.parse(

docs/code_samples/expense_receipts_v5.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<ReceiptV5> response = mindeeClient.parse(

docs/code_samples/financial_document_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<FinancialDocumentV1> response = mindeeClient.parse(

docs/code_samples/idcard_fr_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<IdCardV1> response = mindeeClient.parse(

docs/code_samples/idcard_fr_v2.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<IdCardV2> response = mindeeClient.parse(

docs/code_samples/license_plates_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<LicensePlateV1> response = mindeeClient.parse(

docs/code_samples/multi_receipts_detector_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<MultiReceiptsDetectorV1> response = mindeeClient.parse(

docs/code_samples/passport_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<PassportV1> response = mindeeClient.parse(

docs/code_samples/proof_of_address_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<ProofOfAddressV1> response = mindeeClient.parse(

docs/code_samples/us_driver_license_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<DriverLicenseV1> response = mindeeClient.parse(

docs/code_samples/us_w9_v1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class SimpleMindeeClient {
1515
MindeeClient mindeeClient = new MindeeClient(apiKey);
1616

1717
// Load a file from disk
18-
LocalInputSource inputSource = new LocalInputSource(new File(filePath));
18+
LocalInputSource inputSource = new LocalInputSource(filePath);
1919

2020
// Parse the file
2121
PredictResponse<W9V1> response = mindeeClient.parse(

src/test/java/com/mindee/product/barcodereader/BarcodeReaderV1Test.java

+5-24
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
import com.fasterxml.jackson.databind.JavaType;
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import com.mindee.parsing.common.Document;
6-
import com.mindee.parsing.common.Page;
76
import com.mindee.parsing.common.PredictResponse;
7+
import com.mindee.parsing.standard.ClassificationField;
8+
import com.mindee.product.ProductTestHelper;
89
import org.junit.jupiter.api.Assertions;
910
import org.junit.jupiter.api.Test;
1011
import java.io.File;
1112
import java.io.IOException;
12-
import java.nio.file.Files;
13-
import java.nio.file.Paths;
14-
import java.util.List;
1513

1614
/**
1715
* Unit tests for BarcodeReaderV1.
@@ -44,27 +42,10 @@ void whenEmptyDeserialized_mustHaveValidProperties() throws IOException {
4442
void whenCompleteDeserialized_mustHaveValidDocumentSummary() throws IOException {
4543
PredictResponse<BarcodeReaderV1> response = getPrediction("complete");
4644
Document<BarcodeReaderV1> doc = response.getDocument();
47-
String[] actualLines = doc.toString().split(System.lineSeparator());
48-
List<String> expectedLines = Files.readAllLines(
49-
Paths.get("src/test/resources/products/barcode_reader/response_v1/summary_full.rst")
45+
ProductTestHelper.assertStringEqualsFile(
46+
doc.toString(),
47+
"src/test/resources/products/barcode_reader/response_v1/summary_full.rst"
5048
);
51-
String expectedSummary = String.join(String.format("%n"), expectedLines);
52-
String actualSummary = String.join(String.format("%n"), actualLines);
53-
54-
Assertions.assertEquals(expectedSummary, actualSummary);
5549
}
5650

57-
@Test
58-
void whenCompleteDeserialized_mustHaveValidPage0Summary() throws IOException {
59-
PredictResponse<BarcodeReaderV1> response = getPrediction("complete");
60-
Page<BarcodeReaderV1Document> page = response.getDocument().getInference().getPages().get(0);
61-
String[] actualLines = page.toString().split(System.lineSeparator());
62-
List<String> expectedLines = Files.readAllLines(
63-
Paths.get("src/test/resources/products/barcode_reader/response_v1/summary_page0.rst")
64-
);
65-
String expectedSummary = String.join(String.format("%n"), expectedLines);
66-
String actualSummary = String.join(String.format("%n"), actualLines);
67-
68-
Assertions.assertEquals(expectedSummary, actualSummary);
69-
}
7051
}

src/test/java/com/mindee/product/cropper/CropperV1Test.java

+8-17
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import com.mindee.parsing.common.Document;
66
import com.mindee.parsing.common.Page;
77
import com.mindee.parsing.common.PredictResponse;
8+
import com.mindee.parsing.standard.ClassificationField;
9+
import com.mindee.product.ProductTestHelper;
810
import org.junit.jupiter.api.Assertions;
911
import org.junit.jupiter.api.Test;
1012
import java.io.File;
1113
import java.io.IOException;
12-
import java.nio.file.Files;
13-
import java.nio.file.Paths;
14-
import java.util.List;
1514

1615
/**
1716
* Unit tests for CropperV1.
@@ -43,27 +42,19 @@ void whenEmptyDeserialized_mustHaveValidProperties() throws IOException {
4342
void whenCompleteDeserialized_mustHaveValidDocumentSummary() throws IOException {
4443
PredictResponse<CropperV1> response = getPrediction("complete");
4544
Document<CropperV1> doc = response.getDocument();
46-
String[] actualLines = doc.toString().split(System.lineSeparator());
47-
List<String> expectedLines = Files.readAllLines(
48-
Paths.get("src/test/resources/products/cropper/response_v1/summary_full.rst")
45+
ProductTestHelper.assertStringEqualsFile(
46+
doc.toString(),
47+
"src/test/resources/products/cropper/response_v1/summary_full.rst"
4948
);
50-
String expectedSummary = String.join(String.format("%n"), expectedLines);
51-
String actualSummary = String.join(String.format("%n"), actualLines);
52-
53-
Assertions.assertEquals(expectedSummary, actualSummary);
5449
}
5550

5651
@Test
5752
void whenCompleteDeserialized_mustHaveValidPage0Summary() throws IOException {
5853
PredictResponse<CropperV1> response = getPrediction("complete");
5954
Page<CropperV1Page> page = response.getDocument().getInference().getPages().get(0);
60-
String[] actualLines = page.toString().split(System.lineSeparator());
61-
List<String> expectedLines = Files.readAllLines(
62-
Paths.get("src/test/resources/products/cropper/response_v1/summary_page0.rst")
55+
ProductTestHelper.assertStringEqualsFile(
56+
page.toString(),
57+
"src/test/resources/products/cropper/response_v1/summary_page0.rst"
6358
);
64-
String expectedSummary = String.join(String.format("%n"), expectedLines);
65-
String actualSummary = String.join(String.format("%n"), actualLines);
66-
67-
Assertions.assertEquals(expectedSummary, actualSummary);
6859
}
6960
}

src/test/java/com/mindee/product/eu/licenseplate/LicensePlateV1Test.java

+5-24
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
import com.fasterxml.jackson.databind.JavaType;
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import com.mindee.parsing.common.Document;
6-
import com.mindee.parsing.common.Page;
76
import com.mindee.parsing.common.PredictResponse;
7+
import com.mindee.parsing.standard.ClassificationField;
8+
import com.mindee.product.ProductTestHelper;
89
import org.junit.jupiter.api.Assertions;
910
import org.junit.jupiter.api.Test;
1011
import java.io.File;
1112
import java.io.IOException;
12-
import java.nio.file.Files;
13-
import java.nio.file.Paths;
14-
import java.util.List;
1513

1614
/**
1715
* Unit tests for LicensePlateV1.
@@ -43,27 +41,10 @@ void whenEmptyDeserialized_mustHaveValidProperties() throws IOException {
4341
void whenCompleteDeserialized_mustHaveValidDocumentSummary() throws IOException {
4442
PredictResponse<LicensePlateV1> response = getPrediction("complete");
4543
Document<LicensePlateV1> doc = response.getDocument();
46-
String[] actualLines = doc.toString().split(System.lineSeparator());
47-
List<String> expectedLines = Files.readAllLines(
48-
Paths.get("src/test/resources/products/license_plates/response_v1/summary_full.rst")
44+
ProductTestHelper.assertStringEqualsFile(
45+
doc.toString(),
46+
"src/test/resources/products/license_plates/response_v1/summary_full.rst"
4947
);
50-
String expectedSummary = String.join(String.format("%n"), expectedLines);
51-
String actualSummary = String.join(String.format("%n"), actualLines);
52-
53-
Assertions.assertEquals(expectedSummary, actualSummary);
5448
}
5549

56-
@Test
57-
void whenCompleteDeserialized_mustHaveValidPage0Summary() throws IOException {
58-
PredictResponse<LicensePlateV1> response = getPrediction("complete");
59-
Page<LicensePlateV1Document> page = response.getDocument().getInference().getPages().get(0);
60-
String[] actualLines = page.toString().split(System.lineSeparator());
61-
List<String> expectedLines = Files.readAllLines(
62-
Paths.get("src/test/resources/products/license_plates/response_v1/summary_page0.rst")
63-
);
64-
String expectedSummary = String.join(String.format("%n"), expectedLines);
65-
String actualSummary = String.join(String.format("%n"), actualLines);
66-
67-
Assertions.assertEquals(expectedSummary, actualSummary);
68-
}
6950
}

src/test/java/com/mindee/product/fr/bankaccountdetails/BankAccountDetailsV1Test.java

+5-24
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
import com.fasterxml.jackson.databind.JavaType;
44
import com.fasterxml.jackson.databind.ObjectMapper;
55
import com.mindee.parsing.common.Document;
6-
import com.mindee.parsing.common.Page;
76
import com.mindee.parsing.common.PredictResponse;
7+
import com.mindee.parsing.standard.ClassificationField;
8+
import com.mindee.product.ProductTestHelper;
89
import org.junit.jupiter.api.Assertions;
910
import org.junit.jupiter.api.Test;
1011
import java.io.File;
1112
import java.io.IOException;
12-
import java.nio.file.Files;
13-
import java.nio.file.Paths;
14-
import java.util.List;
1513

1614
/**
1715
* Unit tests for BankAccountDetailsV1.
@@ -45,27 +43,10 @@ void whenEmptyDeserialized_mustHaveValidProperties() throws IOException {
4543
void whenCompleteDeserialized_mustHaveValidDocumentSummary() throws IOException {
4644
PredictResponse<BankAccountDetailsV1> response = getPrediction("complete");
4745
Document<BankAccountDetailsV1> doc = response.getDocument();
48-
String[] actualLines = doc.toString().split(System.lineSeparator());
49-
List<String> expectedLines = Files.readAllLines(
50-
Paths.get("src/test/resources/products/bank_account_details/response_v1/summary_full.rst")
46+
ProductTestHelper.assertStringEqualsFile(
47+
doc.toString(),
48+
"src/test/resources/products/bank_account_details/response_v1/summary_full.rst"
5149
);
52-
String expectedSummary = String.join(String.format("%n"), expectedLines);
53-
String actualSummary = String.join(String.format("%n"), actualLines);
54-
55-
Assertions.assertEquals(expectedSummary, actualSummary);
5650
}
5751

58-
@Test
59-
void whenCompleteDeserialized_mustHaveValidPage0Summary() throws IOException {
60-
PredictResponse<BankAccountDetailsV1> response = getPrediction("complete");
61-
Page<BankAccountDetailsV1Document> page = response.getDocument().getInference().getPages().get(0);
62-
String[] actualLines = page.toString().split(System.lineSeparator());
63-
List<String> expectedLines = Files.readAllLines(
64-
Paths.get("src/test/resources/products/bank_account_details/response_v1/summary_page0.rst")
65-
);
66-
String expectedSummary = String.join(String.format("%n"), expectedLines);
67-
String actualSummary = String.join(String.format("%n"), actualLines);
68-
69-
Assertions.assertEquals(expectedSummary, actualSummary);
70-
}
7152
}

0 commit comments

Comments
 (0)