diff options
author | Thomas <> | 2021-11-15 10:20:07 +0100 |
---|---|---|
committer | Thomas <> | 2021-11-15 10:20:07 +0100 |
commit | 85b20a28e3a44e2c0fd68d10c033bcace0b6203c (patch) | |
tree | 26e7a90ac2088114a746d4b7e1f55f798ce66d51 /eidas_modules/authmodule-eIDAS-v2/src/main | |
parent | 9385171b2137eb71b3b5a0d9524b69fa95b48699 (diff) | |
download | National_eIDAS_Gateway-85b20a28e3a44e2c0fd68d10c033bcace0b6203c.tar.gz National_eIDAS_Gateway-85b20a28e3a44e2c0fd68d10c033bcace0b6203c.tar.bz2 National_eIDAS_Gateway-85b20a28e3a44e2c0fd68d10c033bcace0b6203c.zip |
add jUnit test for InitialSearchTask that uses production like responses from ZMR T-stage
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/tasks/InitialSearchTask.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java index 2341b733..b9769bc4 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/InitialSearchTask.java @@ -23,6 +23,17 @@ package at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks; +import static at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK; +import static at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.jetbrains.annotations.NotNull; +import org.springframework.stereotype.Component; + import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.MatchedPersonResult; import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult; @@ -41,15 +52,6 @@ import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; import at.gv.egiz.eaaf.core.impl.idp.auth.modules.AbstractAuthServletTask; import eu.eidas.auth.commons.light.ILightResponse; import lombok.extern.slf4j.Slf4j; -import org.jetbrains.annotations.NotNull; -import org.springframework.stereotype.Component; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Map; - -import static at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants.TRANSITION_TO_CREATE_NEW_ERNP_ENTRY_TASK; -import static at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK; /** * Searches registers (ERnP and ZMR) after initial user auth, before adding person to SZR. @@ -120,11 +122,14 @@ public class InitialSearchTask extends AbstractAuthServletTask { int resultCount = searchResult.getResultCount(); if (resultCount == 0) { step6CountrySpecificSearch(executionContext, searchResult.getOperationStatus(), eidasData); + } else if (resultCount == 1) { foundMatchFinalizeTask(searchResult, eidasData); + } else { throw new WorkflowException("step2RegisterSearchWithPersonIdentifier", "More than one entry with unique personal-identifier", true); + } } catch (WorkflowException e) { //TODO: what we do in case of a workflow error and manual matching are necessary?? |