Skip to content

Commit 17a1fd8

Browse files
committed
fix: introduce nullable profile data on whoami response
1 parent 79b86ea commit 17a1fd8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/kotlin/com/ctrlhub/core/iam/response/WhoamiResponse.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class IdentityMeta {
2727
}
2828

2929
class Profile {
30-
lateinit var address: ProfileAddress
31-
lateinit var contact: ProfileContact
32-
lateinit var personal: ProfilePersonal
30+
var address: ProfileAddress? = null
31+
var contact: ProfileContact? = null
32+
var personal: ProfilePersonal? = null
3333
lateinit var settings: ProfileSettings
34-
lateinit var work: ProfileWork
34+
var work: ProfileWork? = null
3535
}
3636

3737
class ProfileAddress {

src/test/kotlin/com/ctrlhub/core/iam/IamRouterTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class IamRouterTest {
3434
assertIs<User>(response)
3535
assertEquals("00000000-0000-0000-0000-000000000000", response.id)
3636
assertEquals("[email protected]", response.email)
37-
assertEquals("Test", response.profile.personal.firstName)
38-
assertEquals("User", response.profile.personal.lastName)
37+
assertEquals("Test", response.profile.personal?.firstName)
38+
assertEquals("User", response.profile.personal?.lastName)
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)