aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2020-12-15 23:57:14 +0100
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2021-01-04 14:16:19 +0100
commit3b34f664d0838ff9fb1764fb58813dd6ea83b1df (patch)
tree8208a42b3b066657d44b2044109cecbded2ef072 /eidas_modules/authmodule-eIDAS-v2/src
parent6782b19cc51833b4499984bb92d59fd00f8c0efd (diff)
downloadNational_eIDAS_Gateway-3b34f664d0838ff9fb1764fb58813dd6ea83b1df.tar.gz
National_eIDAS_Gateway-3b34f664d0838ff9fb1764fb58813dd6ea83b1df.tar.bz2
National_eIDAS_Gateway-3b34f664d0838ff9fb1764fb58813dd6ea83b1df.zip
Testcase no match found added
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskFirstTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskFirstTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskFirstTest.java
index 2614f9ba..924a180d 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskFirstTest.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskFirstTest.java
@@ -303,6 +303,38 @@ public class InitialSearchTaskFirstTest {
}
}
+
+ @Test
+ @DirtiesContext
+ /**
+ * NO match found in ZMR and ErnB with Initial search
+ */
+ public void testNode105() throws Exception {
+
+ //Mock ZMR
+ ArrayList<RegisterResult> zmrResult = new ArrayList<>();
+ zmrClient = Mockito.mock(DummyZmrClient.class);
+ Mockito.when(zmrClient.searchWithPersonIdentifer("max123")).thenReturn(zmrResult);//"de/st/max123"???
+ task.setZmrClient(zmrClient);
+
+ //Mock ernb
+ ArrayList<RegisterResult> ernbResult = new ArrayList<>();
+ ernbClient = Mockito.mock(DummyErnbClient.class);
+ Mockito.when(ernbClient.searchWithPersonIdentifer("max123")).thenReturn(ernbResult);//"de/st/max123"???
+ task.setErnbClient(ernbClient);
+
+ try {
+ task.execute(pendingReq, executionContext);
+
+ String bPk = (String)
+ pendingReq.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
+ Assert.assertTrue("Wrong bpk", bPk.equals("105"));
+ } catch (final TaskExecutionException e) {
+ Assert.assertTrue("Wrong workflow, should not reach this point", false);
+ }
+ }
+
+
@NotNull
private AuthenticationResponse buildDummyAuthResponse() throws URISyntaxException {
return buildDummyAuthResponse(RandomStringUtils.randomAlphabetic(10), RandomStringUtils.randomAlphabetic(10),