aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2020-12-15 23:57:14 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2021-01-15 14:17:36 +0100
commitad3f9df147e671522ebbae47e667ce06ef52bf9c (patch)
treeee147ef2f2ff33f41be44d00f5f46d2e3bbf4d33
parentc893656f79dfdda49527aaba6f17f088884602f8 (diff)
downloadNational_eIDAS_Gateway-ad3f9df147e671522ebbae47e667ce06ef52bf9c.tar.gz
National_eIDAS_Gateway-ad3f9df147e671522ebbae47e667ce06ef52bf9c.tar.bz2
National_eIDAS_Gateway-ad3f9df147e671522ebbae47e667ce06ef52bf9c.zip
Testcase no match found added
-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),