diff options
author | lalber <lukas.alber@iaik.tugraz.at> | 2020-11-04 16:42:46 +0100 |
---|---|---|
committer | lalber <lukas.alber@iaik.tugraz.at> | 2020-11-04 16:42:46 +0100 |
commit | a9009a6f89c41dc19b85331dda676993c8a273b9 (patch) | |
tree | e950d8f0d820dfef9496dcc4a4d3a705e2030c99 /eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus | |
parent | e9a093a8d10dcce01661ef5182633e9a296e737e (diff) | |
download | National_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/java/at/asitplus')
-rw-r--r-- | eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/CreateIdentityLinkTaskEidNewTest.java | 34 |
1 files changed, 12 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(); -// } + } } |