Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Commit a95a812

Browse files
committed
Fixed createdAt and modifiedAt in okta user converter.
1 parent faf5fdf commit a95a812

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

impl/src/main/java/com/stormpath/sdk/impl/okta/OktaUserAccountConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ public Map<String, Object> toAccount(Map<String, Object> userMap) {
9191
nullSafePut(accountMap, "customData", trimMap(profileMap, "login", "email", "firstName", "middleName", "lastName"));
9292
}
9393

94-
nullSafePut(accountMap, "createdAt", profileMap.get("created"));
95-
nullSafePut(accountMap, "modifiedAt", profileMap.get("lastUpdated"));
94+
nullSafePut(accountMap, "createdAt", userMap.get("created"));
95+
nullSafePut(accountMap, "modifiedAt", userMap.get("lastUpdated"));
9696
nullSafePut(accountMap, "passwordModifiedAt", profileMap.get("passwordChanged"));
9797

9898
// UserStatus -> AccountStatus enum conversion

impl/src/test/groovy/com/stormpath/sdk/impl/okta/OktaUserAccountConverterTest.groovy

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.stormpath.sdk.resource.Resource
1010
import org.easymock.Capture
1111
import org.easymock.EasyMock
1212
import org.easymock.IAnswer
13+
import org.joda.time.Instant
1314
import org.testng.annotations.Test
1415

1516
import static org.easymock.EasyMock.anyObject
@@ -42,6 +43,7 @@ class OktaUserAccountConverterTest {
4243
statusChanged : "2017-03-06T18:32:12.000Z",
4344
lastLogin : "2017-03-06T18:32:12.000Z",
4445
lastUpdated : "2017-03-06T22:16:30.000Z",
46+
created : "2017-03-06T22:16:30.000Z",
4547
passwordChanged : "2017-03-06T18:32:12.000Z",
4648
credentials : [],
4749
password : [],
@@ -64,7 +66,7 @@ class OktaUserAccountConverterTest {
6466
]
6567

6668
// convert Account map
67-
// def accountMap = new OktaUserAccountConverter().toAccount(userMap)
69+
//def accountMap = new OktaUserAccountConverter().toAccount(userMap)
6870

6971
// create Account object
7072
def internalDataStore = createStrictMock(InternalDataStore)
@@ -80,10 +82,11 @@ class OktaUserAccountConverterTest {
8082
def account = new DefaultAccount(internalDataStore, userMap)
8183

8284
// validate
83-
// verify internalDataStore
85+
// verify internalDataStore
8486
assertThat account.givenName, is("Joe")
8587
assertThat account.customData, allOf(hasEntry("myCustomAttribute", "foobar"))
86-
88+
assertThat account.createdAt, is(Instant.parse("2017-03-06T22:16:30.000Z").toDate())
89+
assertThat account.modifiedAt, is(Instant.parse("2017-03-06T22:16:30.000Z").toDate())
8790

8891
}
8992

0 commit comments

Comments
 (0)