From 7471d2724a9ade98b30296545c39c7d49c690e10 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Wed, 16 Mar 2022 15:37:39 +0100 Subject: test(szr): add second randomized integration test for SZR communication --- .../eidas/v2/test/SzrClientTestProduction.java | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'modules/authmodule-eIDAS-v2/src/test/java/at/asitplus') diff --git a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTestProduction.java b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTestProduction.java index 1e7ff369..0ea62855 100644 --- a/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTestProduction.java +++ b/modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/SzrClientTestProduction.java @@ -104,6 +104,17 @@ public class SzrClientTestProduction { } + @Test + public void getVszRandom() throws SzrCommunicationException, EidasSAuthenticationException { + String vsz = szrClient.getEncryptedStammzahl(getPersonInfo( + RandomStringUtils.randomAlphabetic(10), + familyName, dateOfBirth, + "IS/AT/" + RandomStringUtils.randomAlphanumeric(15) + )); + Assert.assertNotNull("vsz", vsz); + + } + @Test public void getEidasBind() throws SzrCommunicationException, EidasSAuthenticationException { String vsz = RandomStringUtils.randomAlphanumeric(10); @@ -203,7 +214,9 @@ public class SzrClientTestProduction { } } - private PersonInfoType getPersonInfo() throws EidasSAuthenticationException { + private PersonInfoType getPersonInfo(String givenname, String familyname, String dateofbirth, + String eidaseid) throws EidasSAuthenticationException { + final PersonInfoType personInfo = new PersonInfoType(); final PersonNameType personName = new PersonNameType(); final PhysicalPersonType naturalPerson = new PhysicalPersonType(); @@ -215,7 +228,7 @@ public class SzrClientTestProduction { // parse some eID attributes final Triple eIdentifier = - EidasResponseUtils.parseEidasPersonalIdentifier(eIDASeID); + EidasResponseUtils.parseEidasPersonalIdentifier(eidaseid); final String uniqueId = createHashFromUniqueId(eIdentifier.getThird()); final String citizenCountry = eIdentifier.getFirst(); @@ -232,5 +245,11 @@ public class SzrClientTestProduction { Constants.SZR_CONSTANTS_DEFAULT_DOCUMENT_TYPE)); return personInfo; + + } + + private PersonInfoType getPersonInfo() throws EidasSAuthenticationException { + return getPersonInfo(givenName, familyName, dateOfBirth, eIDASeID); + } } -- cgit v1.2.3