From ad3f9df147e671522ebbae47e667ce06ef52bf9c Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Tue, 15 Dec 2020 23:57:14 +0100 Subject: Testcase no match found added --- .../v2/test/tasks/InitialSearchTaskFirstTest.java | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'eidas_modules/authmodule-eIDAS-v2/src/test/java') 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 zmrResult = new ArrayList<>(); + zmrClient = Mockito.mock(DummyZmrClient.class); + Mockito.when(zmrClient.searchWithPersonIdentifer("max123")).thenReturn(zmrResult);//"de/st/max123"??? + task.setZmrClient(zmrClient); + + //Mock ernb + ArrayList 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), -- cgit v1.2.3