From f751604ff725055bee4f37a545a2493b09196c00 Mon Sep 17 00:00:00 2001 From: Alex Burt Date: Fri, 27 Sep 2024 17:04:50 +0100 Subject: [PATCH] SDK-2532: Rename IdentityProfileSubjectPayload -> SubjectPayload --- .../api/client/docs/session/create/SessionSpec.java | 11 +++++------ ...ProfileSubjectPayload.java => SubjectPayload.java} | 8 ++++---- .../client/docs/session/create/SessionSpecTest.java | 6 +++--- 3 files changed, 12 insertions(+), 13 deletions(-) rename yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/{IdentityProfileSubjectPayload.java => SubjectPayload.java} (78%) diff --git a/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SessionSpec.java b/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SessionSpec.java index 34318906..ef5a52a1 100644 --- a/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SessionSpec.java +++ b/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SessionSpec.java @@ -3,7 +3,6 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; -import java.util.Map; import com.yoti.api.client.docs.session.create.check.RequestedCheck; import com.yoti.api.client.docs.session.create.filters.RequiredDocument; @@ -62,7 +61,7 @@ public class SessionSpec { private final AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirements; @JsonProperty(Property.SUBJECT) - private final IdentityProfileSubjectPayload subject; + private final SubjectPayload subject; @JsonProperty(Property.RESOURCES) private final ResourceCreationContainer resources; @@ -83,7 +82,7 @@ public class SessionSpec { IbvOptions ibvOptions, ZonedDateTime sessionDeadline, IdentityProfileRequirementsPayload identityProfile, - IdentityProfileSubjectPayload subject, + SubjectPayload subject, ResourceCreationContainer resources, Boolean createIdentityProfilePreview, AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirements) { @@ -233,7 +232,7 @@ public IdentityProfileRequirementsPayload getIdentityProfile() { * * @return subject */ - public IdentityProfileSubjectPayload getSubject() { + public SubjectPayload getSubject() { return subject; } @@ -280,7 +279,7 @@ public static class Builder { private ZonedDateTime sessionDeadline; private IdentityProfileRequirementsPayload identityProfile; private AdvancedIdentityProfileRequirementsPayload advancedIdentityProfileRequirementsPayload; - private IdentityProfileSubjectPayload subject; + private SubjectPayload subject; private ResourceCreationContainer resources; private Boolean createIdentityProfilePreview; @@ -440,7 +439,7 @@ public Builder withIdentityProfile(IdentityProfileRequirementsPayload identityPr * @param subject the subject * @return the Builder */ - public Builder withSubject(IdentityProfileSubjectPayload subject) { + public Builder withSubject(SubjectPayload subject) { this.subject = subject; return this; } diff --git a/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/IdentityProfileSubjectPayload.java b/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SubjectPayload.java similarity index 78% rename from yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/IdentityProfileSubjectPayload.java rename to yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SubjectPayload.java index 6eeceb9b..513a4059 100644 --- a/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/IdentityProfileSubjectPayload.java +++ b/yoti-sdk-api/src/main/java/com/yoti/api/client/docs/session/create/SubjectPayload.java @@ -2,12 +2,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; -public class IdentityProfileSubjectPayload { +public class SubjectPayload { @JsonProperty("subject_id") private final String subjectId; - IdentityProfileSubjectPayload(String subjectId) { + SubjectPayload(String subjectId) { this.subjectId = subjectId; } @@ -36,8 +36,8 @@ public Builder withSubjectId(String subjectId) { return this; } - public IdentityProfileSubjectPayload build() { - return new IdentityProfileSubjectPayload(subjectId); + public SubjectPayload build() { + return new SubjectPayload(subjectId); } } diff --git a/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SessionSpecTest.java b/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SessionSpecTest.java index 76d4bb39..cf303428 100644 --- a/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SessionSpecTest.java +++ b/yoti-sdk-api/src/test/java/com/yoti/api/client/docs/session/create/SessionSpecTest.java @@ -48,7 +48,7 @@ public class SessionSpecTest { @Mock ResourceCreationContainer resourceCreationContainerMock; @Mock ImportTokenPayload importTokenMock; @Mock IdentityProfileRequirementsPayload identityProfileRequirementsPayloadMock; - @Mock IdentityProfileSubjectPayload identityProfileSubjectPayloadMock; + @Mock SubjectPayload subjectPayloadMock; @Test public void shouldBuildWithMinimalConfiguration() { @@ -218,10 +218,10 @@ public void withIdentityProfile_shouldSetTheIdentityProfile() { @Test public void withSubject_shouldSetTheSubject() { SessionSpec result = SessionSpec.builder() - .withSubject(identityProfileSubjectPayloadMock) + .withSubject(subjectPayloadMock) .build(); - assertThat(result.getSubject(), is(identityProfileSubjectPayloadMock)); + assertThat(result.getSubject(), is(subjectPayloadMock)); } @Test