Skip to content

Commit 76e1bdb

Browse files
authored
Merge pull request #342 from getyoti/RELEASE_3.5.1
RELEASE_3.5.1
2 parents bc7eb6e + e8208e8 commit 76e1bdb

File tree

19 files changed

+81
-64
lines changed

19 files changed

+81
-64
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ If you are using Maven, you need to add the following dependency:
101101
<dependency>
102102
<groupId>com.yoti</groupId>
103103
<artifactId>yoti-sdk-api</artifactId>
104-
<version>3.5.0</version>
104+
<version>3.5.1</version>
105105
</dependency>
106106
```
107107

108108
If you are using Gradle, here is the dependency to add:
109109

110-
`compile group: 'com.yoti', name: 'yoti-sdk-api', version: '3.5.0'`
110+
`compile group: 'com.yoti', name: 'yoti-sdk-api', version: '3.5.1'`
111111

112112
You will find all classes packaged under `com.yoti.api`
113113

examples/doc-scan/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.6.7</version>
8+
<version>2.7.1</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.yoti.docscan.demo</groupId>
@@ -51,7 +51,7 @@
5151
<dependency>
5252
<groupId>com.yoti</groupId>
5353
<artifactId>yoti-sdk-api</artifactId>
54-
<version>3.5.0</version>
54+
<version>3.5.1</version>
5555
</dependency>
5656
</dependencies>
5757

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.yoti</groupId>
66
<artifactId>yoti-sdk</artifactId>
77
<packaging>pom</packaging>
8-
<version>3.5.0</version>
8+
<version>3.5.1</version>
99
<name>Yoti SDK</name>
1010
<description>Java SDK for simple integration with the Yoti platform</description>
1111
<url>https://github.com/getyoti/yoti-java-sdk</url>

yoti-sdk-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.yoti</groupId>
1313
<artifactId>yoti-sdk-parent</artifactId>
14-
<version>3.5.0</version>
14+
<version>3.5.1</version>
1515
<relativePath>../yoti-sdk-parent</relativePath>
1616
</parent>
1717

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
package com.yoti.api.client;
22

3+
import java.util.Optional;
4+
5+
import com.yoti.api.client.spi.remote.call.ErrorDetails;
6+
import com.yoti.api.client.spi.remote.call.ProfileResponse;
7+
38
/**
49
* Signals activity failure -- ie. there was a problem during sharing.
510
*/
611
public class ActivityFailureException extends ProfileException {
712

813
private static final long serialVersionUID = 4496989849870743641L;
914

10-
public ActivityFailureException(String message) {
11-
super(message);
15+
private static final String ERROR_MSG = "Sharing activity unsuccessful for %s%s";
16+
17+
private final ErrorDetails errorDetails;
18+
19+
public ActivityFailureException(ProfileResponse profile) {
20+
super(
21+
String.format(
22+
ERROR_MSG,
23+
profile.getReceipt().getDisplayReceiptId(),
24+
Optional.ofNullable(profile.getError()).map(e -> String.format(" - %s", e)).orElse(""))
25+
);
26+
errorDetails = profile.getError();
27+
}
28+
29+
public ErrorDetails errorDetails() {
30+
return errorDetails;
1231
}
1332

1433
}

yoti-sdk-api/src/main/java/com/yoti/api/client/spi/remote/ReceiptFetcher.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ private void validateReceipt(ProfileResponse profile, String connectToken) throw
5858
.orElseThrow(() -> new ProfileException("No profile for '" + connectToken + "' was found"));
5959

6060
if (!receipt.hasOutcome(Receipt.Outcome.SUCCESS)) {
61-
throw new ActivityFailureException(
62-
String.format("Sharing activity unsuccessful for %s%s",
63-
receipt.getDisplayReceiptId(),
64-
Optional.ofNullable(profile.getError()).map(e -> String.format(" - %s", e)).orElse("")
65-
)
66-
);
61+
throw new ActivityFailureException(profile);
6762
}
6863
}
6964

yoti-sdk-api/src/main/java/com/yoti/api/client/spi/remote/call/ErrorDetails.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package com.yoti.api.client.spi.remote.call;
22

3+
import java.io.Serializable;
34
import java.util.Objects;
45

56
import com.fasterxml.jackson.annotation.JsonProperty;
67
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
78

89
@JsonDeserialize(builder = ErrorDetails.Builder.class)
9-
public final class ErrorDetails {
10+
public final class ErrorDetails implements Serializable {
11+
12+
private static final long serialVersionUID = -6429196723990930305L;
1013

1114
private final String code;
1215
private final String description;

yoti-sdk-api/src/main/java/com/yoti/api/client/spi/remote/call/YotiConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private YotiConstants() {}
2525
public static final String CONTENT_TYPE_JPEG = "image/jpeg";
2626

2727
public static final String JAVA = "Java";
28-
public static final String SDK_VERSION = JAVA + "-3.5.0";
28+
public static final String SDK_VERSION = JAVA + "-3.5.1";
2929
public static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
3030
public static final String ASYMMETRIC_CIPHER = "RSA/NONE/PKCS1Padding";
3131
public static final String SYMMETRIC_CIPHER = "AES/CBC/PKCS7Padding";

yoti-sdk-api/src/test/java/com/yoti/api/client/spi/remote/ReceiptFetcherTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,18 @@ public void shouldFailForFailureReceiptWithErrorCode() throws Exception {
154154
try {
155155
testObj.fetch(encryptedToken, keyPair, APP_ID);
156156
} catch (ActivityFailureException ex) {
157-
assertThat(ex.getMessage(), containsString(ENCODED_RECEIPT_STRING));
158-
assertThat(ex.getMessage(), containsString(errorCode));
159-
assertThat(ex.getMessage(), containsString(errorDescription));
157+
String exMsg = ex.getMessage();
158+
assertThat(exMsg, containsString(ENCODED_RECEIPT_STRING));
159+
assertThat(exMsg, containsString(errorCode));
160+
assertThat(exMsg, containsString(errorDescription));
161+
162+
ErrorDetails exError = ex.errorDetails();
163+
assertThat(exError.getCode(), is(equalTo(errorCode)));
164+
assertThat(exError.getDescription(), is(equalTo(errorDescription)));
165+
160166
return;
161167
}
168+
162169
fail("Expected an Exception");
163170
}
164171

yoti-sdk-parent/pom.xml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<groupId>com.yoti</groupId>
66
<artifactId>yoti-sdk-parent</artifactId>
77
<packaging>pom</packaging>
8-
<version>3.5.0</version>
8+
<version>3.5.1</version>
99
<name>Yoti SDK Parent Pom</name>
1010
<description>Parent pom for the Java SDK projects</description>
1111
<url>https://github.com/getyoti/yoti-java-sdk</url>
@@ -81,28 +81,28 @@
8181
<!-- sdk dependency versions -->
8282
<slf4j.version>1.7.36</slf4j.version>
8383
<bouncy.castle.version>1.70</bouncy.castle.version>
84-
<jackson.version>2.13.2</jackson.version>
85-
<jackson-databind.version>2.13.2.1</jackson-databind.version>
86-
<google.protobuf.version>3.19.4</google.protobuf.version>
84+
<jackson.version>2.13.3</jackson.version>
85+
<jackson-databind.version>2.13.3</jackson-databind.version>
86+
<protobuf-java.version>3.21.2</protobuf-java.version>
8787
<httpmime.version>4.5.13</httpmime.version>
8888

8989
<!-- spring versions -->
90-
<springboot.version>2.6.5</springboot.version>
91-
<spring.core.version>5.3.19</spring.core.version>
92-
<spring.security.version>5.6.2</spring.security.version>
90+
<spring-framework.boot.version>2.7.1</spring-framework.boot.version>
91+
<spring-framework.version>5.3.21</spring-framework.version>
92+
<spring-framework.security.version>5.7.2</spring-framework.security.version>
9393
<javax.servlet.version>4.0.1</javax.servlet.version>
9494

9595
<!-- test libraries -->
9696
<junit.version>4.13.2</junit.version>
97-
<mockito.version>4.4.0</mockito.version>
97+
<mockito.version>4.6.1</mockito.version>
9898
<hamcrest.version>2.2</hamcrest.version>
9999
<commons.lang3.version>3.12.0</commons.lang3.version>
100100

101101
<!-- maven + plugin versions -->
102102
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
103103

104104
<findbugs-maven-plugin.version>3.0.5</findbugs-maven-plugin.version>
105-
<findsecbugs-plugin.version>1.11.0</findsecbugs-plugin.version>
105+
<findsecbugs-plugin.version>1.12.0</findsecbugs-plugin.version>
106106

107107
<dependency-check-maven.version>7.0.4</dependency-check-maven.version>
108108
<dependency-check-maven.cvss.limit>4</dependency-check-maven.cvss.limit>
@@ -112,14 +112,14 @@
112112
<mojo.signature.artefact>java18</mojo.signature.artefact>
113113
<mojo.signature.version>1.0</mojo.signature.version>
114114

115-
<maven-enforcer-plugin.version>3.0.0</maven-enforcer-plugin.version>
115+
<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
116116
<extra-enforcer-rules.version>1.5.1</extra-enforcer-rules.version>
117117

118-
<nnexus-staging-maven-plugin.version>1.6.12</nnexus-staging-maven-plugin.version>
118+
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
119119

120120
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
121121

122-
<maven-javadoc-plugin.version>3.3.2</maven-javadoc-plugin.version>
122+
<maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
123123
<maven-javadoc-plugin.source>8</maven-javadoc-plugin.source>
124124

125125
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
@@ -128,7 +128,7 @@
128128

129129
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
130130

131-
<jacoco-maven-plugin.version>0.8.7</jacoco-maven-plugin.version>
131+
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
132132
</properties>
133133

134134
<dependencyManagement>
@@ -153,7 +153,7 @@
153153
<dependency>
154154
<groupId>com.google.protobuf</groupId>
155155
<artifactId>protobuf-java</artifactId>
156-
<version>${google.protobuf.version}</version>
156+
<version>${protobuf-java.version}</version>
157157
</dependency>
158158
<dependency>
159159
<groupId>org.slf4j</groupId>
@@ -180,42 +180,42 @@
180180
<dependency>
181181
<groupId>org.springframework.boot</groupId>
182182
<artifactId>spring-boot-autoconfigure</artifactId>
183-
<version>${springboot.version}</version>
183+
<version>${spring-framework.boot.version}</version>
184184
</dependency>
185185
<dependency>
186186
<groupId>org.springframework</groupId>
187187
<artifactId>spring-core</artifactId>
188-
<version>${spring.core.version}</version>
188+
<version>${spring-framework.version}</version>
189189
</dependency>
190190
<dependency>
191191
<groupId>org.springframework</groupId>
192192
<artifactId>spring-aop</artifactId>
193-
<version>${spring.core.version}</version>
193+
<version>${spring-framework.version}</version>
194194
</dependency>
195195
<dependency>
196196
<groupId>org.springframework</groupId>
197197
<artifactId>spring-beans</artifactId>
198-
<version>${spring.core.version}</version>
198+
<version>${spring-framework.version}</version>
199199
</dependency>
200200
<dependency>
201201
<groupId>org.springframework</groupId>
202202
<artifactId>spring-web</artifactId>
203-
<version>${spring.core.version}</version>
203+
<version>${spring-framework.version}</version>
204204
</dependency>
205205
<dependency>
206206
<groupId>org.springframework.security</groupId>
207207
<artifactId>spring-security-web</artifactId>
208-
<version>${spring.security.version}</version>
208+
<version>${spring-framework.security.version}</version>
209209
</dependency>
210210
<dependency>
211211
<groupId>org.springframework</groupId>
212212
<artifactId>spring-context</artifactId>
213-
<version>${spring.core.version}</version>
213+
<version>${spring-framework.version}</version>
214214
</dependency>
215215
<dependency>
216216
<groupId>org.springframework</groupId>
217217
<artifactId>spring-expression</artifactId>
218-
<version>${spring.core.version}</version>
218+
<version>${spring-framework.version}</version>
219219
</dependency>
220220
<dependency>
221221
<groupId>javax.servlet</groupId>
@@ -380,7 +380,7 @@
380380
<plugin>
381381
<groupId>org.sonatype.plugins</groupId>
382382
<artifactId>nexus-staging-maven-plugin</artifactId>
383-
<version>${nnexus-staging-maven-plugin.version}</version>
383+
<version>${nexus-staging-maven-plugin.version}</version>
384384
<extensions>true</extensions>
385385
<configuration>
386386
<serverId>ossrh</serverId>

0 commit comments

Comments
 (0)