diff options
author | Thomas <> | 2022-02-09 08:34:26 +0100 |
---|---|---|
committer | Thomas <> | 2022-02-09 08:34:26 +0100 |
commit | e4ccd3df84e7ea509e66f2f832719529fe408839 (patch) | |
tree | b6f543ed6711cf2640f8668307c85b5f576206bb /eidas_modules/authmodule-eIDAS-v2/src/test/java | |
parent | 63e7e29f8d2a367c32f0151e9ad93eb86abeb404 (diff) | |
download | National_eIDAS_Gateway-e4ccd3df84e7ea509e66f2f832719529fe408839.tar.gz National_eIDAS_Gateway-e4ccd3df84e7ea509e66f2f832719529fe408839.tar.bz2 National_eIDAS_Gateway-e4ccd3df84e7ea509e66f2f832719529fe408839.zip |
feature(zmr): add MDS attributes as 'eIdAS-Documents' too
ZMR does not allow MDS update on regular places. Therefore, we add it as 'eIDAS-Documents' for later usage.
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/test/java')
3 files changed, 34 insertions, 11 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java index 290eefe4..2ff9f0cb 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/clients/ZmrClientTest.java @@ -940,13 +940,19 @@ public class ZmrClientTest { assertEquals("2 req. tech. Ref. date", "2020-02-05T13:07:06.311", secondpSuche.getPersonReferenz().getTechnisch().getLetzteAenderung().toString()); - assertEquals("eidas Docs. size", 3, secondpSuche.getEidasIdentitaetAnlage().size()); + assertEquals("eidas Docs. size", 6, secondpSuche.getEidasIdentitaetAnlage().size()); checkEidasDocumentAdd(secondpSuche.getEidasIdentitaetAnlage(), "http://eidas.europa.eu/attributes/naturalperson/PlaceOfBirth", cc, eidasData.getPlaceOfBirth()); checkEidasDocumentAdd(secondpSuche.getEidasIdentitaetAnlage(), "http://eidas.europa.eu/attributes/naturalperson/BirthName", cc, eidasData.getBirthName()); checkEidasDocumentAdd(secondpSuche.getEidasIdentitaetAnlage(), - "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", cc, eidasData.getPseudonym()); + "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", cc, eidasData.getPseudonym()); + checkEidasDocumentAdd(secondpSuche.getEidasIdentitaetAnlage(), + "http://eidas.europa.eu/attributes/naturalperson/CurrentGivenName", cc, eidasData.getGivenName()); + checkEidasDocumentAdd(secondpSuche.getEidasIdentitaetAnlage(), + "http://eidas.europa.eu/attributes/naturalperson/CurrentFamilyName", cc, eidasData.getFamilyName()); + checkEidasDocumentAdd(secondpSuche.getEidasIdentitaetAnlage(), + "http://eidas.europa.eu/attributes/naturalperson/DateOfBirth", cc, eidasData.getDateOfBirth()); // validate state @@ -1110,8 +1116,7 @@ public class ZmrClientTest { assertEquals("eidas Docs. size", 1, secondpSuche.getEidasIdentitaetAnlage().size()); checkEidasDocumentAdd(secondpSuche.getEidasIdentitaetAnlage(), "http://eidas.europa.eu/attributes/naturalperson/PersonIdentifier", cc, eidasData.getPseudonym()); - - + // validate state assertNotNull("no ZMR response", resp); assertEquals("wrong processId", "366200000000082", resp.getProcessId().toString()); diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/AlternativeSearchTaskWithRegisterTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/AlternativeSearchTaskWithRegisterTest.java index 66807ee0..3814c632 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/AlternativeSearchTaskWithRegisterTest.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/AlternativeSearchTaskWithRegisterTest.java @@ -71,6 +71,7 @@ import at.asitplus.eidas.specific.modules.auth.eidas.v2.utils.MatchingTaskUtils; import at.gv.bmi.namespace.zmr_su.base._20040201.RequestType; import at.gv.bmi.namespace.zmr_su.base._20040201.ResponseType; import at.gv.bmi.namespace.zmr_su.base._20040201_.ServicePort; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.EidasIdentitaetAnlageType; import at.gv.bmi.namespace.zmr_su.zmr._20040201.EidasSuchdatenType; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; @@ -509,7 +510,16 @@ public class AlternativeSearchTaskWithRegisterTest { assertNotNull("PersonAender KITT req.", zmrReq.getAllValues().get(2).getPersonAendernRequest()); checkBasicRequestParameters(zmrReq.getAllValues().get(2), ZmrClientTest.PROCESS_TASK_UPDATE, new BigInteger("367100000000079"), "jUnit123456"); - + + assertEquals("wrong number of eIDAS Docs to Add", 4, + zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage().size()); + checkEidasDocumentAdd(zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage(), + "http://eidas.europa.eu/attributes/naturalperson/DateOfBirth", "DE", "1994-12-31"); + checkEidasDocumentAdd(zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage(), + "http://eidas.europa.eu/attributes/naturalperson/CurrentGivenName", "DE", "XXXKlaus - Maria"); + checkEidasDocumentAdd(zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage(), + "http://eidas.europa.eu/attributes/naturalperson/CurrentFamilyName", "DE", "XXXvon Brandenburg"); + assertNotNull("Personensuche KITT req.", zmrReq.getAllValues().get(3).getPersonSuchenRequest()); checkBasicRequestParameters(zmrReq.getAllValues().get(3), ZmrClientTest.PROCESS_TASK_SEARCH, new BigInteger("367100000000079"), "jUnit123456"); @@ -1011,6 +1021,18 @@ public class AlternativeSearchTaskWithRegisterTest { } + + private void checkEidasDocumentAdd(List<EidasIdentitaetAnlageType> list, String type, String cc, String value) { + Optional<EidasIdentitaetAnlageType> eidasDoc = list.stream() + .filter(el -> type.equals(el.getEidasArt())) + .findFirst(); + + assertTrue("eidas doc: " + type, eidasDoc.isPresent()); + assertEquals("eIDAS docType", type, eidasDoc.get().getEidasArt()); + assertEquals("eIDAS docValue", value, eidasDoc.get().getEidasWert()); + assertEquals("eIDAS docCC", cc, eidasDoc.get().getStaatscode2()); + } + @NotNull private ErnpRegisterResult emptyErnpRegisterResult() { return new ErnpRegisterResult(Collections.emptyList()); diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskWithRegistersTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskWithRegistersTest.java index 7f27a17c..18d76264 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskWithRegistersTest.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskWithRegistersTest.java @@ -283,12 +283,8 @@ public class InitialSearchTaskWithRegistersTest { assertNotNull("Personenupdate req.", zmrReq.getAllValues().get(2).getPersonAendernRequest()); checkBasicRequestParameters(zmrReq.getAllValues().get(2), ZmrClientTest.PROCESS_TASK_UPDATE, new BigInteger("367100000000079"), "jUnit123456"); - assertEquals("eIDAS attribute to add", 1, - zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage().size()); - assertEquals("eIDAS attribute to add - Type", "http://eidas.europa.eu/attributes/naturalperson/PlaceOfBirth", - zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage().get(0).getEidasArt()); - assertEquals("eIDAS attribute to add - Value", placeOfBirth, - zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage().get(0).getEidasWert()); + assertEquals("eIDAS attribute to add", 4, + zmrReq.getAllValues().get(2).getPersonAendernRequest().getEidasIdentitaetAnlage().size()); assertNull("ZMR update MDS", zmrReq.getAllValues().get(2).getPersonAendernRequest().getPersonAenderung()); } |