diff options
author | Thomas <> | 2022-02-08 17:35:24 +0100 |
---|---|---|
committer | Thomas <> | 2022-02-08 17:35:24 +0100 |
commit | 0fb02a267d231ce130f7ea419cade9a0cc79bb6e (patch) | |
tree | 96fed6e6bb90cb10531c6443c4e27816bc1d24b4 | |
parent | a16e5ba2c6030788524e6dc49f6bb5ae4f0cabe0 (diff) | |
download | National_eIDAS_Gateway-0fb02a267d231ce130f7ea419cade9a0cc79bb6e.tar.gz National_eIDAS_Gateway-0fb02a267d231ce130f7ea419cade9a0cc79bb6e.tar.bz2 National_eIDAS_Gateway-0fb02a267d231ce130f7ea419cade9a0cc79bb6e.zip |
fix(matching): update wrong error-reason and remove an unused method parameter
2 files changed, 20 insertions, 7 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java index 08d2bfa1..89a3f350 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/tasks/ReceiveAustrianResidenceGuiResponseTask.java @@ -117,11 +117,11 @@ public class ReceiveAustrianResidenceGuiResponseTask extends AbstractLocaleAuthS AdresssucheOutput input = parseHtmlInput(request); if (validateHtmlInput(input)) { // HTML form should ensure that mandatory fields are set => this should never happen - log.warn("HTML form contains no residence information. Switch back to 'other matching' selection ... "); + log.warn("HTML form contains no residence information. Switch back to 'other matching' selection ... "); executionContext.put(TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK, true); - - executionContext.put(CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON, MSG_PROP_20); - executionContext.put(CONTEXT_FLAG_ADVANCED_MATCHING_FAILED, true); + + executionContext.put(CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON, MSG_PROP_21); + executionContext.put(CONTEXT_FLAG_ADVANCED_MATCHING_FAILED, true); return; } @@ -145,7 +145,7 @@ public class ReceiveAustrianResidenceGuiResponseTask extends AbstractLocaleAuthS } else { log.debug("Find single match by using residence information. Starting data validation ... "); - compareSearchResultWithInitialData(executionContext, residencyResult, eidasData); + compareSearchResultWithInitialData(residencyResult, eidasData); } @@ -167,8 +167,7 @@ public class ReceiveAustrianResidenceGuiResponseTask extends AbstractLocaleAuthS && StringUtils.isEmpty(input.getVillage()); } - private void compareSearchResultWithInitialData(ExecutionContext executionContext, - RegisterStatusResults residencyResult, SimpleEidasData eidasData) + private void compareSearchResultWithInitialData(RegisterStatusResults residencyResult, SimpleEidasData eidasData) throws TaskExecutionException, EaafStorageException { try { if (!eidasData.equalsRegisterData(residencyResult.getResult())) { diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAustrianResidenceGuiResponseTaskTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAustrianResidenceGuiResponseTaskTest.java index 15edce07..7758e021 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAustrianResidenceGuiResponseTaskTest.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/ReceiveAustrianResidenceGuiResponseTaskTest.java @@ -108,6 +108,20 @@ public class ReceiveAustrianResidenceGuiResponseTaskTest { } @Test + public void noInputData() throws Exception { + RegisterStatusResults registerSearchResult = buildEmptyResult(); + MatchingTaskUtils.storeIntermediateMatchingResult(pendingReq, registerSearchResult); + + task.execute(pendingReq, executionContext); + + assertEquals("Transition To S9", true, executionContext.get(Constants.TRANSITION_TO_GENERATE_OTHER_LOGIN_METHOD_GUI_TASK)); + assertEquals("matching failed flag", true, executionContext.get(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED)); + assertEquals("failed reason", "module.eidasauth.matching.21", executionContext.get(Constants.CONTEXT_FLAG_ADVANCED_MATCHING_FAILED_REASON)); + assertNull("no final matching result", MatchingTaskUtils.getFinalMatchingResult(pendingReq)); + + } + + @Test public void noRegisterResult() throws Exception { AdresssucheOutput userInput = setupUserInput(); SimpleEidasData eidasData = setupEidasData(); |