Skip to content

Commit b0687fa

Browse files
authored
Merge pull request #183 from getyoti/hotfix-2.7.1
Release 2.7.1
2 parents 533750f + a8bd03c commit b0687fa

File tree

15 files changed

+64
-30
lines changed

15 files changed

+64
-30
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ If you are using Maven, you need to add the following dependency:
104104
<dependency>
105105
<groupId>com.yoti</groupId>
106106
<artifactId>yoti-sdk-impl</artifactId>
107-
<version>2.7.0</version>
107+
<version>2.7.1</version>
108108
</dependency>
109109
```
110110

111111
If you are using Gradle, here is the dependency to add:
112112

113-
`compile group: 'com.yoti', name: 'yoti-sdk-impl', version: '2.7.0'`
113+
`compile group: 'com.yoti', name: 'yoti-sdk-impl', version: '2.7.1'`
114114

115115
You will find all classes packaged under `com.yoti.api`
116116

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>2.7.0</version>
8+
<version>2.7.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>2.7.0</version>
14+
<version>2.7.1</version>
1515
<relativePath>../yoti-sdk-parent</relativePath>
1616
</parent>
1717

yoti-sdk-api/src/main/java/com/yoti/api/client/shareurl/extension/ThirdPartyAttributeContent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public ThirdPartyAttributeContent(Date expiryDate, List<AttributeDefinition> def
2323
@JsonProperty("expiry_date")
2424
public String getExpiryDate() {
2525
SimpleDateFormat rfcDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
26+
rfcDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
2627
return rfcDateFormat.format(expiryDate.getTime());
2728
}
2829

yoti-sdk-impl/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>2.7.0</version>
14+
<version>2.7.1</version>
1515
<relativePath>../yoti-sdk-parent</relativePath>
1616
</parent>
1717

yoti-sdk-impl/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 + "-2.7.0";
28+
public static final String SDK_VERSION = JAVA + "-2.7.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-impl/src/test/java/com/yoti/api/client/shareurl/extension/SimpleThirdPartyAttributeExtensionBuilderTest.java

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package com.yoti.api.client.shareurl.extension;
22

3-
import com.fasterxml.jackson.databind.ObjectMapper;
4-
import com.yoti.api.client.AttributeDefinition;
5-
import com.yoti.api.client.spi.remote.call.YotiConstants;
6-
import org.junit.Test;
3+
import static org.hamcrest.MatcherAssert.assertThat;
4+
import static org.hamcrest.Matchers.containsString;
5+
import static org.hamcrest.Matchers.is;
6+
import static org.junit.Assert.assertEquals;
7+
import static org.junit.Assert.fail;
78

89
import java.text.SimpleDateFormat;
910
import java.util.ArrayList;
1011
import java.util.Date;
1112
import java.util.List;
1213
import java.util.TimeZone;
1314

14-
import static org.hamcrest.MatcherAssert.assertThat;
15-
import static org.hamcrest.Matchers.containsString;
16-
import static org.hamcrest.Matchers.is;
17-
import static org.junit.Assert.assertEquals;
18-
import static org.junit.Assert.fail;
15+
import com.yoti.api.client.AttributeDefinition;
16+
import com.yoti.api.client.spi.remote.call.YotiConstants;
17+
18+
import org.junit.Test;
1919

2020
public class SimpleThirdPartyAttributeExtensionBuilderTest {
2121

@@ -68,9 +68,7 @@ public void shouldBuildThirdPartyAttributeExtensionWithGivenValues() {
6868
.withDefinition(SOME_DEFINITION)
6969
.build();
7070

71-
SimpleDateFormat sdf = new SimpleDateFormat(YotiConstants.RFC3339_PATTERN_MILLIS);
72-
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
73-
String formattedTestDate = sdf.format(SOME_DATE);
71+
String formattedTestDate = formatDateToString(SOME_DATE);
7472

7573
assertEquals(ExtensionConstants.THIRD_PARTY_ATTRIBUTE, extension.getType());
7674
assertEquals(formattedTestDate, extension.getContent().getExpiryDate());
@@ -80,6 +78,35 @@ public void shouldBuildThirdPartyAttributeExtensionWithGivenValues() {
8078
assertThat(definitions.get(0).getName(), is(SOME_DEFINITION));
8179
}
8280

81+
@Test
82+
public void shouldBuildThirdPartyAttributeExtensionWithCorrectlyFormattedDateString() {
83+
TimeZone.setDefault(TimeZone.getTimeZone("America/New_York"));
84+
Date date = new Date();
85+
86+
Extension<ThirdPartyAttributeContent> extension = new SimpleThirdPartyAttributeExtensionBuilder()
87+
.withExpiryDate(date)
88+
.withDefinition(SOME_DEFINITION)
89+
.build();
90+
91+
String formattedTestDate = formatDateToString(date);
92+
93+
assertEquals(formattedTestDate, extension.getContent().getExpiryDate());
94+
}
95+
96+
@Test
97+
public void shouldWorkCorrectlyWithDateCreatedFromTimestamp() {
98+
Date date = new Date(1586252260);
99+
100+
Extension<ThirdPartyAttributeContent> extension = new SimpleThirdPartyAttributeExtensionBuilder()
101+
.withExpiryDate(date)
102+
.withDefinition(SOME_DEFINITION)
103+
.build();
104+
105+
String formattedTestDate = formatDateToString(date);
106+
107+
assertEquals(formattedTestDate, extension.getContent().getExpiryDate());
108+
}
109+
83110
@Test
84111
public void shouldBuildThirdPartyAttributeExtensionWithMultipleDefinitions() {
85112
List<String> theDefinitions = new ArrayList<>();
@@ -119,4 +146,10 @@ public void shouldOverwriteSingularlyAddedDefinition() {
119146
assertThat(definitions.get(1).getName(), is("secondDefinition"));
120147
}
121148

149+
private String formatDateToString(Date date) {
150+
SimpleDateFormat sdf = new SimpleDateFormat(YotiConstants.RFC3339_PATTERN_MILLIS);
151+
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
152+
return sdf.format(date);
153+
}
154+
122155
}

yoti-sdk-parent/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-parent</artifactId>
77
<packaging>pom</packaging>
8-
<version>2.7.0</version>
8+
<version>2.7.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>

yoti-sdk-sandbox/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>2.7.0</version>
14+
<version>2.7.1</version>
1515
<relativePath>../yoti-sdk-parent</relativePath>
1616
</parent>
1717

yoti-sdk-spring-boot-auto-config/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ If you are using Maven, you need to add the following dependencies:
1818
<dependency>
1919
<groupId>com.yoti</groupId>
2020
<artifactId>yoti-sdk-spring-boot-auto-config</artifactId>
21-
<version>2.7.0</version>
21+
<version>2.7.1</version>
2222
</dependency>
2323
```
2424

2525

2626
If you are using Gradle, here is the dependency to add:
2727

2828
```
29-
compile group: 'com.yoti', name: 'yoti-sdk-spring-boot-auto-config', version: '2.7.0'
29+
compile group: 'com.yoti', name: 'yoti-sdk-spring-boot-auto-config', version: '2.7.1'
3030
```
3131

3232

0 commit comments

Comments
 (0)