aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/main
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-01-15 16:56:29 +0100
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-01-15 16:56:29 +0100
commit09751b59f7e2da247c32324826607e5f1eef0f10 (patch)
treee9843b65cbaa5b73695ecba39988cf6c01c0955d /eidas_modules/authmodule-eIDAS-v2/src/main
parent891f01d3f79307a5a5bd9c352af16814fcb2b764 (diff)
downloadNational_eIDAS_Gateway-09751b59f7e2da247c32324826607e5f1eef0f10.tar.gz
National_eIDAS_Gateway-09751b59f7e2da247c32324826607e5f1eef0f10.tar.bz2
National_eIDAS_Gateway-09751b59f7e2da247c32324826607e5f1eef0f10.zip
fix for test102*
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/dao/SimpleEidasData.java20
1 files changed, 17 insertions, 3 deletions
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);
+ }
}