aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/test
diff options
context:
space:
mode:
authorThomas <>2021-06-25 10:26:17 +0200
committerThomas <>2021-06-25 10:26:17 +0200
commitaf013acbb41d98b39d5ede56dbd5227858688e33 (patch)
tree2847ca6db2d957de1d816f79e4b005e33c2de944 /eidas_modules/authmodule-eIDAS-v2/src/test
parent293ad818005f6d0434f2e1140535e9e7b9e5cd25 (diff)
downloadNational_eIDAS_Gateway-af013acbb41d98b39d5ede56dbd5227858688e33.tar.gz
National_eIDAS_Gateway-af013acbb41d98b39d5ede56dbd5227858688e33.tar.bz2
National_eIDAS_Gateway-af013acbb41d98b39d5ede56dbd5227858688e33.zip
fix bug in combination with EidasNode v2.5 and DE Middleware
# Conflicts: # connector/src/main/resources/application.properties
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/test')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java
index f796bd86..4edfe32d 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/GenerateAuthnRequestTaskTest.java
@@ -1,5 +1,7 @@
package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.tasks;
+import static org.junit.Assert.assertNull;
+
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
@@ -91,7 +93,8 @@ public class GenerateAuthnRequestTaskTest {
"http://test/" + RandomStringUtils.randomAlphabetic(5));
basicConfig.putConfigValue(
"eidas.ms.auth.eIDAS.node_v2.forward.method", "GET");
-
+ basicConfig.removeConfigValue("eidas.ms.auth.eIDAS.node_v2.requested.nameIdFormat");
+
}
@Test
@@ -313,9 +316,8 @@ public class GenerateAuthnRequestTaskTest {
Assert.assertEquals("ProviderName is not Static", "myNode", eidasReq.getProviderName());
Assert.assertEquals("no PublicSP", "public", eidasReq.getSpType());
Assert.assertEquals("wrong LoA", "http://eidas.europa.eu/LoA/high", eidasReq.getLevelOfAssurance());
- Assert.assertEquals("wrong CC", cc, eidasReq.getCitizenCountryCode());
- Assert.assertEquals("NameIdFormat", Constants.eIDAS_REQ_NAMEID_FORMAT, eidasReq.getNameIdFormat());
-
+ Assert.assertEquals("wrong CC", cc, eidasReq.getCitizenCountryCode());
+ assertNull("NameIdPolicy not null", eidasReq.getNameIdFormat());
}
@@ -337,6 +339,10 @@ public class GenerateAuthnRequestTaskTest {
basicConfig.putConfigValue(
"eidas.ms.auth.eIDAS.node_v2.workarounds.useStaticProviderNameForPublicSPs", "false");
+ String nameIdFormat = RandomStringUtils.randomAlphabetic(10);
+ basicConfig.putConfigValue(
+ "eidas.ms.auth.eIDAS.node_v2.requested.nameIdFormat", nameIdFormat);
+
String dynEndPoint = "http://test/" + RandomStringUtils.randomAlphabetic(5);
basicConfig.putConfigValue(
"eidas.ms.auth.eIDAS.node_v2.forward.endpoint", dynEndPoint);
@@ -363,6 +369,7 @@ public class GenerateAuthnRequestTaskTest {
eidasReq.getLevelOfAssurance());
Assert.assertEquals("Wrong req. attr. size", 4, eidasReq.getRequestedAttributes().size());
+ Assert.assertEquals("NameIdFormat", nameIdFormat, eidasReq.getNameIdFormat());
}