aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus
diff options
context:
space:
mode:
authorChristian Kollmann <christian.kollmann@a-sit.at>2021-02-22 13:57:50 +0100
committerChristian Kollmann <christian.kollmann@a-sit.at>2021-02-22 15:03:35 +0100
commit39b5e38cc5e3c7c555ae10e0ff0f684c9bcc0966 (patch)
tree4d48783d597d83d424237a39a3b1152d383a4e13 /eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus
parent5207fa3eedfaf2d8b6e27ff38c32a716fb25193c (diff)
downloadNational_eIDAS_Gateway-39b5e38cc5e3c7c555ae10e0ff0f684c9bcc0966.tar.gz
National_eIDAS_Gateway-39b5e38cc5e3c7c555ae10e0ff0f684c9bcc0966.tar.bz2
National_eIDAS_Gateway-39b5e38cc5e3c7c555ae10e0ff0f684c9bcc0966.zip
Add service to consolidate register search access
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/InitialSearchTaskTest.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskTest.java b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskTest.java
index d855c98d..ae2bc93e 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskTest.java
+++ b/eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskTest.java
@@ -29,6 +29,7 @@ import at.asitplus.eidas.specific.modules.auth.eidas.v2.ernp.IErnpClient;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.exception.ManualFixNecessaryException;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.handler.DeSpecificDetailSearchProcessor;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.handler.ItSpecificDetailSearchProcessor;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.RegisterSearchService;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.InitialSearchTask;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.IZmrClient;
import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext;
@@ -85,6 +86,7 @@ public class InitialSearchTaskTest {
private IZmrClient zmrClient;
@Mock
private IErnpClient ernpClient;
+ private RegisterSearchService registerSearchService;
final ExecutionContext executionContext = new ExecutionContextImpl();
private TestRequestImpl pendingReq;
@@ -103,7 +105,8 @@ public class InitialSearchTaskTest {
@Before
public void setUp() throws URISyntaxException, EaafStorageException {
MockitoAnnotations.initMocks(this);
- task = new InitialSearchTask(new ArrayList<>(), ernpClient, zmrClient);
+ registerSearchService = new RegisterSearchService(zmrClient, ernpClient);
+ task = new InitialSearchTask(new ArrayList<>(), registerSearchService, ernpClient, zmrClient);
MockHttpServletRequest httpReq = new MockHttpServletRequest("POST", "https://localhost/authhandler");
MockHttpServletResponse httpResp = new MockHttpServletResponse();
@@ -250,7 +253,7 @@ public class InitialSearchTaskTest {
Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
task = new InitialSearchTask(
Collections.singletonList(new ItSpecificDetailSearchProcessor(ernpClient, zmrClient)),
- ernpClient, zmrClient);
+ registerSearchService, ernpClient, zmrClient);
task.execute(pendingReq1, executionContext);
@@ -280,7 +283,7 @@ public class InitialSearchTaskTest {
Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
task = new InitialSearchTask(
Collections.singletonList(new DeSpecificDetailSearchProcessor(ernpClient, zmrClient)),
- ernpClient, zmrClient);
+ registerSearchService, ernpClient, zmrClient);
task.execute(pendingReq1, executionContext);
@@ -316,7 +319,7 @@ public class InitialSearchTaskTest {
Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
task = new InitialSearchTask(
Collections.singletonList(new DeSpecificDetailSearchProcessor(ernpClient, zmrClient)),
- ernpClient, zmrClient);
+ registerSearchService, ernpClient, zmrClient);
TaskExecutionException exception = assertThrows(TaskExecutionException.class,
() -> task.execute(pendingReq1, executionContext));
@@ -349,7 +352,7 @@ public class InitialSearchTaskTest {
Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
task = new InitialSearchTask(
Collections.singletonList(new ItSpecificDetailSearchProcessor(ernpClient, zmrClient)),
- ernpClient, zmrClient);
+ registerSearchService, ernpClient, zmrClient);
TaskExecutionException exception = assertThrows(TaskExecutionException.class,
() -> task.execute(pendingReq1, executionContext));