From 09751b59f7e2da247c32324826607e5f1eef0f10 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Fri, 15 Jan 2021 16:56:29 +0100 Subject: fix for test102* --- .../modules/auth/eidas/v2/dao/SimpleEidasData.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus') diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java index 57597122..b86984d0 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/dao/SimpleEidasData.java @@ -46,6 +46,7 @@ public class SimpleEidasData { /** * Compares the register result with the eidas data. + * * @param result The register data to use for comparison * @return true or false depending of the data matches * @throws WorkflowException if multiple results have been found @@ -67,15 +68,28 @@ public class SimpleEidasData { if (!result.getDateOfBirth().equals(dateOfBirth)) { return false; } - if (!result.getPlaceOfBirth().equals(placeOfBirth)) { + if (!equals(result.getPlaceOfBirth(), placeOfBirth)) { return false; } - if (!result.getBirthName().equals(birthName)) { + if (!equals(result.getBirthName(), birthName)) { return false; } - if (!result.getTaxNumber().equals(taxNumber)) { + if (!equals(result.getTaxNumber(), taxNumber)) { return false; } return true; } + + private boolean equals(String a, String b) { + if (a == null && b == null) { + return true; + } + if (a == null && b != null) { + return false; + } + if (a != null && b == null) { + return false; + } + return a.equals(b); + } } -- cgit v1.2.3