diff options
author | Thomas <> | 2021-11-12 16:59:55 +0100 |
---|---|---|
committer | Thomas <> | 2021-11-12 16:59:55 +0100 |
commit | 9385171b2137eb71b3b5a0d9524b69fa95b48699 (patch) | |
tree | 4c2fbf175ddecdfd2f81a3e56c6c1d16c5b0e834 /eidas_modules/authmodule-eIDAS-v2/src/main | |
parent | e279dbd74d956d8aeaab397a7d4ca765dbad6a33 (diff) | |
download | National_eIDAS_Gateway-9385171b2137eb71b3b5a0d9524b69fa95b48699.tar.gz National_eIDAS_Gateway-9385171b2137eb71b3b5a0d9524b69fa95b48699.tar.bz2 National_eIDAS_Gateway-9385171b2137eb71b3b5a0d9524b69fa95b48699.zip |
fix some small bugs in ZMR client that we found by adding jUnit tests
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main')
-rw-r--r-- | eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java index 0edfb357..711226e2 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/clients/zmr/ZmrSoapClient.java @@ -132,9 +132,10 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { searchPersonReq.getEidasSuchdaten().add(eidasInfos); eidasInfos.setEidasArt(Constants.eIDAS_ATTRURN_PERSONALIDENTIFIER); eidasInfos.setEidasWert(personPseudonym); - + eidasInfos.setStaatscode2(citizenCountryCode); + // set work-flow client information - req.setWorkflowInfoClient(generateWorkFlowInfos(PROCESS_TASK_SEARCH, null)); + req.setWorkflowInfoClient(generateWorkFlowInfos(PROCESS_TASK_SEARCH, zmrProzessId)); req.setClientInfo(generateClientInfos()); // set additionl search parameters @@ -277,7 +278,7 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { log.info("Find #{} eIDAS documents for update during: {}", eidasDocumentToAdd.size(), PROCESS_KITT_GENERAL); // update entry based on selected update info's and results from search response - return updatePersonInZmr(zmrPersonToKitt, eidasDocumentToAdd, eidData.getCitizenCountryCode()); + return updatePersonInZmr(zmrProzessId, zmrPersonToKitt, eidasDocumentToAdd, eidData.getCitizenCountryCode()); } @@ -517,7 +518,7 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { log.error("Find more-than-one ZMR entry with search criteria that has to be unique"); throw new WorkflowException(processStepFiendlyname, "Find more-than-one ZMR entry with search criteria that has to be unique", true); - + } else { return Arrays.asList(processPersonResult(personErgebnisSatz.get(0), citizenCountryCode)); @@ -533,7 +534,7 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { personEl.getPersonendaten().getPersonErgebnis().size()); if (personEl.getPersonendaten().getPersonErgebnis().size() > 1) { - log.error("Find more than on person with eIDAS personalIdentifier."); + log.error("Find more than on PersoenErgebnis in Personendaten."); throw new EaafAuthenticationException(ERROR_MATCHING_02, null); } else { @@ -573,6 +574,7 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { .map(el -> el.getValue()) .orElse(null); if (StringUtils.isEmpty(bpk)) { + //TODO: should we throw an error in that case? log.warn("ZMR response contains no 'bPK' for target: 'ZP'"); } @@ -749,13 +751,13 @@ public class ZmrSoapClient extends AbstractSoapClient implements IZmrClient { } } - private ZmrRegisterResult updatePersonInZmr(PersonErgebnisType zmrPersonToKitt, + private ZmrRegisterResult updatePersonInZmr(BigInteger zmrProzessId, PersonErgebnisType zmrPersonToKitt, Collection<? extends EidasIdentitaetAnlageType> eidasDocumentToAdd, String citizenCountryCode) throws ServiceFault { final RequestType req = new RequestType(); // set work-flow client information - req.setWorkflowInfoClient(generateWorkFlowInfos(PROCESS_TASK_UPDATE, null)); + req.setWorkflowInfoClient(generateWorkFlowInfos(PROCESS_TASK_UPDATE, zmrProzessId)); req.setClientInfo(generateClientInfos()); PersonAendernRequest updateReq = new PersonAendernRequest(); |