From d1c4bc0619b95564f6f7db5798479449e88e4793 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Wed, 9 Dec 2020 08:53:28 +0100 Subject: added (non working) test --- .../auth/eidas/v2/tasks/InitialSearchTask.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java') 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 6f4cfefc..907ed443 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 @@ -64,7 +64,7 @@ import java.util.List; import java.util.Map; /** - * Task that creates the IdentityLink for an eIDAS authenticated person. + * Task that searches ErnB and ZMR before adding person to SZR. * * @author tlenz */ @@ -150,16 +150,13 @@ public class InitialSearchTask extends AbstractAuthServletTask { String personIdentifier = eidData.getPseudonym(); //search in register(step 2) MergedRegisterSearchResult result = searchInZmrAndErnp(personIdentifier); - switch (result.getResultCount()) { - case 0: - step5(result, eidData); - break; - case 1: - step3(result, eidData); - break; - default://should not happen - throw new TaskExecutionException(pendingReq, "Initial search - Kitt Process necessary.", - new ManualFixNecessaryException(personIdentifier)); + if (result.getResultCount() == 0) { + step5(result, eidData); + } else if (result.getResultCount() == 1) { + step3(result, eidData); + } else if (result.getResultCount() > 1) { + throw new TaskExecutionException(pendingReq, "Initial search - Kitt Process necessary.", + new ManualFixNecessaryException(personIdentifier)); } } -- cgit v1.2.3