diff options
author | Thomas <> | 2022-01-19 14:00:06 +0100 |
---|---|---|
committer | Thomas <> | 2022-01-19 14:00:06 +0100 |
commit | 122245400a8cbf72f65a206592eb15f70826ace9 (patch) | |
tree | dc2126cc95a3afb61771bc3c8b58337377d5652f /eaaf_modules | |
parent | 4932d6e3ef8b2347ecb0c66d5b8206fcfa54d77d (diff) | |
download | EAAF-Components-122245400a8cbf72f65a206592eb15f70826ace9.tar.gz EAAF-Components-122245400a8cbf72f65a206592eb15f70826ace9.tar.bz2 EAAF-Components-122245400a8cbf72f65a206592eb15f70826ace9.zip |
refactor(core): change API parameters from 'Date' to 'Instant'
Diffstat (limited to 'eaaf_modules')
3 files changed, 8 insertions, 8 deletions
diff --git a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/Pvp2AssertionBuilder.java b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/Pvp2AssertionBuilder.java index 88ff2206..733301be 100644 --- a/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/Pvp2AssertionBuilder.java +++ b/eaaf_modules/eaaf_module_pvp2_idp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/idp/impl/builder/Pvp2AssertionBuilder.java @@ -363,8 +363,7 @@ public class Pvp2AssertionBuilder implements PvpConstants { final SubjectConfirmationData subjectConfirmationData = Saml2Utils.createSamlObject(SubjectConfirmationData.class); subjectConfirmationData.setInResponseTo(authnRequest.getID()); - subjectConfirmationData - .setNotOnOrAfter(Instant.ofEpochMilli(authData.getSsoSessionValidTo().getTime())); + subjectConfirmationData.setNotOnOrAfter(authData.getSsoSessionValidTo()); // set 'recipient' attribute in subjectConformationData subjectConfirmationData.setRecipient(assertionConsumerService.getLocation()); diff --git a/eaaf_modules/eaaf_module_pvp2_idp/src/test/java/at/gv/egiz/eaaf/modules/pvp2/idp/test/AuthenticationActionTest.java b/eaaf_modules/eaaf_module_pvp2_idp/src/test/java/at/gv/egiz/eaaf/modules/pvp2/idp/test/AuthenticationActionTest.java index cab14a5d..466bcf22 100644 --- a/eaaf_modules/eaaf_module_pvp2_idp/src/test/java/at/gv/egiz/eaaf/modules/pvp2/idp/test/AuthenticationActionTest.java +++ b/eaaf_modules/eaaf_module_pvp2_idp/src/test/java/at/gv/egiz/eaaf/modules/pvp2/idp/test/AuthenticationActionTest.java @@ -1,6 +1,6 @@ package at.gv.egiz.eaaf.modules.pvp2.idp.test; -import java.util.Date; +import java.time.Instant; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.time.DateFormatUtils; @@ -104,7 +104,7 @@ public class AuthenticationActionTest { } @Override - public Date getSsoSessionValidTo() { + public Instant getSsoSessionValidTo() { return null; } @@ -208,8 +208,8 @@ public class AuthenticationActionTest { } @Override - public Date getAuthenticationIssueInstant() { - return new Date(); + public Instant getAuthenticationIssueInstant() { + return Instant.now(); } @Override diff --git a/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java b/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java index f87096fb..4d8c8993 100644 --- a/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java +++ b/eaaf_modules/eaaf_module_pvp2_sp/src/main/java/at/gv/egiz/eaaf/modules/pvp2/sp/impl/utils/AssertionAttributeExtractor.java @@ -19,6 +19,7 @@ package at.gv.egiz.eaaf.modules.pvp2.sp.impl.utils; +import java.time.Instant; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -314,9 +315,9 @@ public class AssertionAttributeExtractor { * * @return Date, when the SAML2 assertion was issued, otherwise null */ - public Date getAssertionIssuingDate() { + public Instant getAssertionIssuingDate() { try { - return Date.from(getFullAssertion().getIssueInstant()); + return getFullAssertion().getIssueInstant(); } catch (final NullPointerException e) { return null; |