Skip to content

Commit 9a3afb9

Browse files
authored
Decode types type changing and test (#71)
* Decode types imports to necessary requests * Added tests for recognize with many types. * RecognizeWithManyTypes test fixed for old java
1 parent 71d4213 commit 9a3afb9

File tree

7 files changed

+40
-8
lines changed

7 files changed

+40
-8
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Freleases.aspose.cloud%2Fjava%2Frepo%2Fcom%2Faspose%2Faspose-barcode-cloud%2Fmaven-metadata.xml)](https://releases.aspose.cloud/java/repo/com/aspose/aspose-barcode-cloud/)
66

77
- API version: 3.0
8-
- SDK version: 24.1.0
8+
- SDK version: 24.1.1
99

1010
## Demo applications
1111

@@ -68,7 +68,7 @@ Add this dependency to your project's POM:
6868
<dependency>
6969
<groupId>com.aspose</groupId>
7070
<artifactId>aspose-barcode-cloud</artifactId>
71-
<version>24.1.0</version>
71+
<version>24.1.1</version>
7272
<scope>compile</scope>
7373
</dependency>
7474
```
@@ -83,7 +83,7 @@ mvn clean package
8383

8484
Then manually install the following JARs:
8585

86-
- `target/aspose-barcode-cloud-24.1.0.jar`
86+
- `target/aspose-barcode-cloud-24.1.1.jar`
8787
- `target/lib/*.jar`
8888

8989
## Getting Started

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>aspose-barcode-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>aspose-barcode-cloud</name>
8-
<version>24.1.0</version>
8+
<version>24.1.1</version>
99
<url>https://www.aspose.cloud</url>
1010
<description>Aspose.BarCode Cloud SDK for Java</description>
1111
<scm>

src/main/java/com/aspose/barcode/cloud/ApiClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
/** ApiClient. */
6767
public class ApiClient {
6868
public final String apiVersion = "v3.0";
69-
public final String clientVersion = "24.1.0";
69+
public final String clientVersion = "24.1.1";
7070

7171
private String baseUrl = "https://api.aspose.cloud";
7272
private String tokenUrl = baseUrl + "/connect/token";
@@ -110,7 +110,7 @@ protected ApiClient() {
110110
json = new JSON();
111111

112112
// Set default User-Agent.
113-
setUserAgent("Swagger-Codegen/24.1.0/java");
113+
setUserAgent("Swagger-Codegen/24.1.1/java");
114114

115115
addDefaultHeader("x-aspose-client", "java sdk");
116116
addDefaultHeader("x-aspose-client-version", clientVersion);

src/main/java/com/aspose/barcode/cloud/requests/GetBarcodeRecognizeRequest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
package com.aspose.barcode.cloud.requests;
2727

28+
import com.aspose.barcode.cloud.model.DecodeBarcodeType;
29+
2830
import java.util.List;
2931

3032
/** Recognize barcode from a file on server. */
@@ -36,7 +38,7 @@ public class GetBarcodeRecognizeRequest {
3638
public String type;
3739

3840
/** Multiple barcode types to read.. */
39-
public List<String> types;
41+
public List<DecodeBarcodeType> types;
4042

4143
/**
4244
* Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for

src/main/java/com/aspose/barcode/cloud/requests/PostBarcodeRecognizeFromUrlOrContentRequest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
package com.aspose.barcode.cloud.requests;
2727

28+
import com.aspose.barcode.cloud.model.DecodeBarcodeType;
29+
2830
import java.io.File;
2931
import java.util.List;
3032

@@ -38,7 +40,7 @@ public class PostBarcodeRecognizeFromUrlOrContentRequest {
3840
public String type;
3941

4042
/** Multiple barcode types to read.. */
41-
public List<String> types;
43+
public List<DecodeBarcodeType> types;
4244

4345
/**
4446
* Enable checksum validation during recognition for 1D barcodes. Default is treated as Yes for

src/test/java/com/aspose/barcode/cloud/test/BarcodeApiTest.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import java.io.File;
1515
import java.nio.file.Path;
1616
import java.nio.file.Paths;
17+
import java.util.Arrays;
1718
import java.util.List;
1819

1920
/** API tests for BarcodeApi */
@@ -77,6 +78,33 @@ public void getBarcodeRecognizeTest() throws ApiException {
7778
assertTrue(region.get(0).getY() > 0);
7879
}
7980

81+
/**
82+
* Recognize barcode from a file on server with multiple types in params
83+
*
84+
* @throws ApiException if the Api call fails
85+
*/
86+
@Test
87+
public void getBarcodeRecognizeWithTypesTest() throws ApiException {
88+
String testFileName = "ManyTypes.png";
89+
uploadTestFile(testFileName);
90+
91+
GetBarcodeRecognizeRequest request = new GetBarcodeRecognizeRequest(testFileName);
92+
request.types =
93+
Arrays.asList(
94+
DecodeBarcodeType.QR, DecodeBarcodeType.CODE128, DecodeBarcodeType.CODE11);
95+
request.checksumValidation = ChecksumValidation.OFF.toString();
96+
request.preset = PresetType.HIGHPERFORMANCE.toString();
97+
request.storage = testStorageName;
98+
request.folder = remoteTempFolder;
99+
100+
BarcodeResponseList response = api.getBarcodeRecognize(request);
101+
102+
assertNotNull(response);
103+
assertFalse(response.getBarcodes().isEmpty());
104+
105+
assertEquals(3, response.getBarcodes().size());
106+
}
107+
80108
private void uploadTestFile(String testFileName) throws ApiException {
81109
Path filePath = Paths.get(testDataPath, testFileName);
82110
File file = new File(filePath.toString());

test_data/ManyTypes.png

78.9 KB
Loading

0 commit comments

Comments
 (0)