aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'eidas_modules/authmodule-eIDAS-v2/src/test')
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/eidas/specific/modules/auth/eidas/v2/test/tasks/InitialSearchTaskFirstTest.java55
1 files changed, 17 insertions, 38 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 35e2e56e..1f512354 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
@@ -67,6 +67,7 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Random;
@@ -136,9 +137,7 @@ public class InitialSearchTaskFirstTest {
String newFirstName = RandomStringUtils.randomAlphabetic(5);
zmrResult.add(new RegisterResult(randomBpk, DE_ST+randomIdentifier, newFirstName, randomFamilyName, randomDate));
Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResult);
-
- ArrayList<RegisterResult> ernpResult = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResult);
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
task.execute(pendingReq, executionContext);
String bPk = (String)
@@ -152,9 +151,7 @@ public class InitialSearchTaskFirstTest {
@Test
@DirtiesContext
public void testNode100_UserIdentifiedUpdateNecessary_b() throws TaskExecutionException {
- ArrayList<RegisterResult> zmrResult = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResult);
-
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
ArrayList<RegisterResult> ernpResult = new ArrayList<>();
String randomBpk = RandomStringUtils.randomNumeric(6);
ernpResult.add(new RegisterResult(randomBpk, DE_ST+randomIdentifier, "Max_new", randomFamilyName, randomDate));
@@ -177,9 +174,7 @@ public class InitialSearchTaskFirstTest {
zmrResult.add(new RegisterResult("bpkMax", DE_ST+randomIdentifier, randomGivenName, randomFamilyName, randomDate));
zmrResult.add(new RegisterResult("bpkMax", DE_ST+randomIdentifier, "Maximilian", randomFamilyName, randomDate));
Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResult);
-
- ArrayList<RegisterResult> ernpResult = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResult);
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
TaskExecutionException exception = assertThrows(TaskExecutionException.class,
() -> task.execute(pendingReq, executionContext));
@@ -195,9 +190,7 @@ public class InitialSearchTaskFirstTest {
@DirtiesContext
public void testNode101_ManualFixNecessary_b() {
String randombpk = RandomStringUtils.random(5);
- ArrayList<RegisterResult> zmrResult = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResult);
-
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
ArrayList<RegisterResult> ernpResult = new ArrayList<>();
ernpResult.add(new RegisterResult(randombpk, DE_ST+randomIdentifier, randomGivenName, randomFamilyName, randomDate));
ernpResult.add(new RegisterResult(randombpk, DE_ST+randomIdentifier, randomGivenName+RandomStringUtils.random(2),
@@ -218,8 +211,7 @@ public class InitialSearchTaskFirstTest {
@DirtiesContext
public void testNode102_UserIdentified_a() throws Exception {
String randomBpk = RandomStringUtils.randomNumeric(12);
- ArrayList<RegisterResult> zmrResult = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResult);
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
ArrayList<RegisterResult> ernpResult = new ArrayList<>();
ernpResult.add(new RegisterResult(randomBpk, DE_ST+randomIdentifier, randomGivenName, randomFamilyName, randomDate));
@@ -242,9 +234,7 @@ public class InitialSearchTaskFirstTest {
ArrayList<RegisterResult> zmrResult = new ArrayList<>();
zmrResult.add(new RegisterResult(randomBpk, DE_ST+randomIdentifier, randomGivenName, randomFamilyName, randomDate));
Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResult);
-
- ArrayList<RegisterResult> ernpResult = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResult);
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
task.execute(pendingReq, executionContext);
String bPk = (String)
@@ -265,8 +255,7 @@ public class InitialSearchTaskFirstTest {
pendingReq1.getSessionData(AuthProcessDataWrapper.class)
.setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
- ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResultInitial);
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
zmrResultSpecific.add(new RegisterResult(bpkRegister, IT_ST+randomIdentifier+RandomStringUtils.random(2),
@@ -276,8 +265,7 @@ public class InitialSearchTaskFirstTest {
Mockito.when(zmrClient.searchItSpecific(taxNumber)).thenReturn(zmrResultSpecific);
- ArrayList<RegisterResult> ernpResultInitial = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResultInitial);
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
List<CountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
ItSpecificDetailSearchProcessor it = new ItSpecificDetailSearchProcessor(ernpClient, zmrClient);
@@ -310,8 +298,7 @@ public class InitialSearchTaskFirstTest {
pendingReq1.getSessionData(AuthProcessDataWrapper.class)
.setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
- ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResultInitial);
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
zmrResultSpecific.add(new RegisterResult(bpk, pseudonym, givenName, familyName, dateOfBirth, placeOfBirth,
@@ -320,8 +307,7 @@ public class InitialSearchTaskFirstTest {
Mockito.when(zmrClient.searchDeSpecific(givenName, familyName, dateOfBirth, placeOfBirth, birthName)).thenReturn(zmrResultSpecific);
- ArrayList<RegisterResult> ernpResultInitial = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResultInitial);
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
List<CountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
DeSpecificDetailSearchProcessor de = new DeSpecificDetailSearchProcessor(ernpClient, zmrClient);
@@ -356,8 +342,7 @@ public class InitialSearchTaskFirstTest {
pendingReq1.getSessionData(AuthProcessDataWrapper.class)
.setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
- ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResultInitial);
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
zmrResultSpecific.add(new RegisterResult(bpk1, pseudonym1, givenName, familyName, dateOfBirth, placeOfBirth,
@@ -368,8 +353,7 @@ public class InitialSearchTaskFirstTest {
null, null));
Mockito.when(zmrClient.searchDeSpecific(givenName, familyName, dateOfBirth, placeOfBirth, birthName)).thenReturn(zmrResultSpecific);
- ArrayList<RegisterResult> ernpResultInitial = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResultInitial);
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
List<CountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
DeSpecificDetailSearchProcessor de = new DeSpecificDetailSearchProcessor(ernpClient, zmrClient);
@@ -397,8 +381,7 @@ public class InitialSearchTaskFirstTest {
pendingReq1.getSessionData(AuthProcessDataWrapper.class)
.setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
- ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResultInitial);
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
zmrResultSpecific.add(new RegisterResult("bpkMax", IT_ST+randomIdentifier+"4", randomGivenName, randomFamilyName,
@@ -409,8 +392,7 @@ public class InitialSearchTaskFirstTest {
fakeTaxNumber, null));
Mockito.when(zmrClient.searchItSpecific(fakeTaxNumber)).thenReturn(zmrResultSpecific);
- ArrayList<RegisterResult> ernpResultInitial = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResultInitial);
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
List<CountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
ItSpecificDetailSearchProcessor it = new ItSpecificDetailSearchProcessor(ernpClient, zmrClient);
@@ -430,11 +412,8 @@ public class InitialSearchTaskFirstTest {
@Test
@DirtiesContext
public void testNode105_TemporaryEnd() throws TaskExecutionException {
- ArrayList<RegisterResult> zmrResult = new ArrayList<>();
- Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(zmrResult);
-
- ArrayList<RegisterResult> ernpResult = new ArrayList<>();
- Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(ernpResult);
+ Mockito.when(zmrClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
+ Mockito.when(ernpClient.searchWithPersonIdentifier(randomIdentifier)).thenReturn(Collections.emptyList());
task.execute(pendingReq, executionContext);
String bPk = (String)