aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/test
diff options
context:
space:
mode:
authorlalber <lukas.alber@iaik.tugraz.at>2020-11-04 16:42:46 +0100
committerlalber <lukas.alber@iaik.tugraz.at>2020-11-04 16:42:46 +0100
commita9009a6f89c41dc19b85331dda676993c8a273b9 (patch)
treee950d8f0d820dfef9496dcc4a4d3a705e2030c99 /eidas_modules/authmodule-eIDAS-v2/src/test
parente9a093a8d10dcce01661ef5182633e9a296e737e (diff)
downloadNational_eIDAS_Gateway-a9009a6f89c41dc19b85331dda676993c8a273b9.tar.gz
National_eIDAS_Gateway-a9009a6f89c41dc19b85331dda676993c8a273b9.tar.bz2
National_eIDAS_Gateway-a9009a6f89c41dc19b85331dda676993c8a273b9.zip
fix pw aliasname
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/CreateIdentityLinkTaskEidNewTest.java34
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_3.properties2
2 files changed, 14 insertions, 22 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java
index 031ea825..00e01a2c 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java
@@ -1,5 +1,8 @@
package at.asitplus.eidas.specific.modules.auth.eidas.v2.test.tasks;
+import static at.asitplus.eidas.specific.connector.MsEidasNodeConstants.PROP_CONFIG_SP_AUTHBLOCK_FRIENDLYNAME;
+import static at.asitplus.eidas.specific.connector.MsEidasNodeConstants.PROP_CONFIG_SP_AUTHBLOCK_PW;
+import static at.asitplus.eidas.specific.connector.MsEidasNodeConstants.PROP_CONFIG_SP_EID_MODE;
import static org.mockito.ArgumentMatchers.any;
import static org.powermock.api.mockito.PowerMockito.when;
@@ -81,6 +84,9 @@ public class CreateIdentityLinkTaskEidNewTest {
private TestRequestImpl pendingReq;
private DummySpConfiguration oaParam;
private SZR szrMock;
+
+ private static final String PW = "f/+saJBc3a}*/T^s";
+ private static final String ALIAS = "connectorkeypair";
@Rule
public final SoapServiceRule soap = SoapServiceRule.newInstance();
@@ -112,13 +118,17 @@ public class CreateIdentityLinkTaskEidNewTest {
final Map<String, String> spConfig = new HashMap<>();
spConfig.put(EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER, "testSp");
spConfig.put("target", "urn:publicid:gv.at:cdid+XX");
- spConfig.put("eidMode", "new");
+ spConfig.put(PROP_CONFIG_SP_EID_MODE, "new");
+ spConfig.put(PROP_CONFIG_SP_AUTHBLOCK_PW, PW);
+ spConfig.put(PROP_CONFIG_SP_AUTHBLOCK_FRIENDLYNAME, ALIAS);
oaParam = new DummySpConfiguration(spConfig, basicConfig);
pendingReq = new TestRequestImpl();
AuthenticationResponse response = buildDummyAuthResponse();
+
+
pendingReq.getSessionData(AuthProcessDataWrapper.class).setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
pendingReq.setSpConfig(oaParam);
pendingReq.setPendingReqId(at.gv.egiz.eaaf.core.impl.utils.Random.nextProcessReferenceValue());
@@ -169,40 +179,20 @@ public class CreateIdentityLinkTaskEidNewTest {
String test = szrMock.getStammzahlEncrypted(new PersonInfoType(), false);
-// SZR szrMock2 = Mockito.mock(SZR.class, Mockito.CALLS_REAL_METHODS);
when(szrMock, "getStammzahlEncrypted", any(), any()).thenReturn(RandomStringUtils.randomNumeric(10));
val signContentResp = new SignContentResponseType();
SignContentEntry signContentEntry = new SignContentEntry();
signContentEntry.setValue(RandomStringUtils.randomAlphanumeric(10));
signContentResp.getOut().add(signContentEntry);
when(szrMock, "signContent", any(), any(), any()).thenReturn(signContentResp);
-// when(szrMock2, "getStammzahlEncrypted", any(), any()).thenReturn(RandomStringUtils.randomNumeric(10));
- // Wie kann ich das vom Bean rein gehängte SZR mit dem Mock überschreiben?
-
task.execute(pendingReq, executionContext);
-// authTask.execute(pendingReq, executionContext);
} catch (Exception e) {
e.printStackTrace();
Assert.fail();
}
-// val spyTask = spy(task);
-// Map<String, Object> requiredAttributes = new HashMap<>();
-// requiredAttributes.put(Constants.eIDAS_ATTR_PERSONALIDENTIFIER, "asdf");
-// requiredAttributes.put(Constants.eIDAS_ATTR_CURRENTFAMILYNAME, "asdf");
-// requiredAttributes.put(Constants.eIDAS_ATTR_CURRENTGIVENNAME, "asdf");
-// requiredAttributes.put(Constants.eIDAS_ATTR_DATEOFBIRTH, new DateTime());
-// requiredAttributes.put(Constants.eIDAS_ATTR_PLACEOFBIRTH, "adf");
-// requiredAttributes.put(Constants.eIDAS_ATTR_BIRTHNAME, "adf");
-// requiredAttributes.put(Constants.eIDAS_ATTR_CURRENTADDRESS, new PostalAddressType());
-// try {
-// doReturn(requiredAttributes).when(spyTask, "convertEidasAttrToSimpleMap", (any(ImmutableMap.class)));
-// spyTask.execute(pendingReq, executionContext);
-// } catch (final Exception e) {
-// e.printStackTrace();
-// Assert.fail();
-// }
+
}
}
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_3.properties b/eidas_modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_3.properties
index 326e14fe..33207118 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_3.properties
+++ b/eidas_modules/authmodule-eIDAS-v2/src/test/resources/config/junit_config_3.properties
@@ -94,6 +94,8 @@ eidas.ms.sp.0.uniqueID=
eidas.ms.sp.0.pvp2.metadata.truststore=
eidas.ms.sp.0.pvp2.metadata.truststore.password=
eidas.ms.sp.0.eidMode=new
+eidas.ms.sp.0.authblock.truststore.password=f/+saJBc3a}*/T^s
+eidas.ms.sp.0.authblock.truststore.friendlyName=connectorkeypair
#eidas.ms.sp.0.friendlyName=
#eidas.ms.sp.0.pvp2.metadata.url=