aboutsummaryrefslogtreecommitdiff
path: root/eidas_modules/authmodule-eIDAS-v2/src/test
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2020-12-17 13:18:37 +0100
committerThomas Lenz <thomas.lenz@egiz.gv.at>2021-01-15 14:19:26 +0100
commit21613f2d1af10639b65077c5600763e82b5eb63c (patch)
treeac273db909dbbb40edb6cdf0d09af9971553c819 /eidas_modules/authmodule-eIDAS-v2/src/test
parent20b28fa85e5fc24868b22fa769e87f1dcacf205a (diff)
downloadNational_eIDAS_Gateway-21613f2d1af10639b65077c5600763e82b5eb63c.tar.gz
National_eIDAS_Gateway-21613f2d1af10639b65077c5600763e82b5eb63c.tar.bz2
National_eIDAS_Gateway-21613f2d1af10639b65077c5600763e82b5eb63c.zip
country specific tests
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.java305
-rw-r--r--eidas_modules/authmodule-eIDAS-v2/src/test/resources/SpringTest-context_tasks_test.xml7
2 files changed, 258 insertions, 54 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 5c75d1e4..64a73bda 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
@@ -5,6 +5,9 @@ import at.asitplus.eidas.specific.modules.auth.eidas.v2.dao.RegisterResult;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb.DummyErnbClient;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.ernb.IErnbClient;
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.ICountrySpecificDetailSearchProcessor;
+import at.asitplus.eidas.specific.modules.auth.eidas.v2.handler.ItSpecificDetailSearchProcessor;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.tasks.InitialSearchTask;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.DummyZmrClient;
import at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.IZmrClient;
@@ -25,7 +28,6 @@ import org.jetbrains.annotations.NotNull;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
@@ -47,6 +49,7 @@ import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
+import java.util.List;
@RunWith(SpringJUnit4ClassRunner.class)
@@ -107,54 +110,55 @@ public class InitialSearchTaskFirstTest {
@Test
@DirtiesContext
/**
- * Two matches found in ZMR
+ * One match, but register update needed
*/
- public void testNode101a() throws Exception {
+ public void testNode100a() throws Exception {
//Mock ZMR
ArrayList<RegisterResult> zmrResult = new ArrayList<>();
- zmrResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "1111-01-01"));
- zmrResult.add(new RegisterResult("bpkMax","de/st/max123", "Maximilian", "Mustermann", "1111-01-01"));
+ String randomBpk = RandomStringUtils.randomNumeric(6);
+ zmrResult.add(new RegisterResult(randomBpk,"de/st/max123", "Max_new", "Mustermann", "2011-01-01"));
+
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);
- Assert.assertTrue("Wrong workflow, should not reach this point/ get a bpk", false);
String bPk = (String)
pendingReq.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
+ Assert.assertTrue("Wrong bpk", bPk.equals(randomBpk));
} catch (final TaskExecutionException e) {
- Throwable origE = e.getOriginalException();
- Assert.assertTrue("Wrong exception", (origE.getCause() instanceof ManualFixNecessaryException));
+ Assert.assertTrue("Wrong workflow, should not reach this point", false);
}
}
-
@Test
@DirtiesContext
/**
- * Two matches found in ErnB
+ * One match, but register update needed
*/
- public void testNode101b() throws Exception {
+ public void testNode100b() 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<>();
- ernbResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "1111-01-01"));
- ernbResult.add(new RegisterResult("bpkMax","de/st/max123", "Maximilian", "Mustermann", "1111-01-01"));
+ String randomBpk = RandomStringUtils.randomNumeric(6);
+ ernbResult.add(new RegisterResult(randomBpk,"de/st/max123", "Max_new", "Mustermann", "2011-01-01"));
ernbClient = Mockito.mock(DummyErnbClient.class);
Mockito.when(ernbClient.searchWithPersonIdentifer("max123")).thenReturn(ernbResult);//"de/st/max123"???
@@ -162,68 +166,67 @@ public class InitialSearchTaskFirstTest {
try {
task.execute(pendingReq, executionContext);
- Assert.assertTrue("Wrong workflow, should not reach this point/ get a bpk", false);
String bPk = (String)
pendingReq.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
+ Assert.assertTrue("Wrong bpk", bPk.equals(randomBpk));
} catch (final TaskExecutionException e) {
- Throwable origE = e.getOriginalException();
- Assert.assertTrue("Wrong exception", (origE.getCause() instanceof ManualFixNecessaryException));
+ Assert.assertTrue("Wrong workflow, should not reach this point", false);
}
}
+
@Test
@DirtiesContext
/**
- * One match, but register update needed
+ * Two matches found in ZMR
*/
- public void testNode100a() throws Exception {
+ public void testNode101a() throws Exception {
//Mock ZMR
ArrayList<RegisterResult> zmrResult = new ArrayList<>();
- String randomBpk = RandomStringUtils.randomNumeric(6);
- zmrResult.add(new RegisterResult(randomBpk,"de/st/max123", "Max_new", "Mustermann", "1111-01-01"));
-
+ zmrResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "2011-01-01"));
+ zmrResult.add(new RegisterResult("bpkMax","de/st/max123", "Maximilian", "Mustermann", "2011-01-01"));
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);
+ Assert.assertTrue("Wrong workflow, should not reach this point/ get a bpk", false);
String bPk = (String)
pendingReq.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
- Assert.assertTrue("Wrong bpk", bPk.equals(randomBpk));
} catch (final TaskExecutionException e) {
- Assert.assertTrue("Wrong workflow, should not reach this point", false);
+ Throwable origE = e.getOriginalException();
+ Assert.assertTrue("Wrong exception", (origE.getCause() instanceof ManualFixNecessaryException));
}
}
+
@Test
@DirtiesContext
/**
- * One match, but register update needed
+ * Two matches found in ErnB
*/
- public void testNode100b() throws Exception {
+ public void testNode101b() 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<>();
- String randomBpk = RandomStringUtils.randomNumeric(6);
- ernbResult.add(new RegisterResult(randomBpk,"de/st/max123", "Max_new", "Mustermann", "1111-01-01"));
+ ernbResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "2011-01-01"));
+ ernbResult.add(new RegisterResult("bpkMax","de/st/max123", "Maximilian", "Mustermann", "2011-01-01"));
ernbClient = Mockito.mock(DummyErnbClient.class);
Mockito.when(ernbClient.searchWithPersonIdentifer("max123")).thenReturn(ernbResult);//"de/st/max123"???
@@ -231,12 +234,13 @@ public class InitialSearchTaskFirstTest {
try {
task.execute(pendingReq, executionContext);
+ Assert.assertTrue("Wrong workflow, should not reach this point/ get a bpk", false);
String bPk = (String)
pendingReq.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
- Assert.assertTrue("Wrong bpk", bPk.equals(randomBpk));
} catch (final TaskExecutionException e) {
- Assert.assertTrue("Wrong workflow, should not reach this point", false);
+ Throwable origE = e.getOriginalException();
+ Assert.assertTrue("Wrong exception", (origE.getCause() instanceof ManualFixNecessaryException));
}
}
@@ -255,7 +259,7 @@ public class InitialSearchTaskFirstTest {
//Mock ernb
ArrayList<RegisterResult> ernbResult = new ArrayList<>();
- ernbResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "1111-01-01"));
+ ernbResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "2011-01-01"));
ernbClient = Mockito.mock(DummyErnbClient.class);
Mockito.when(ernbClient.searchWithPersonIdentifer("max123")).thenReturn(ernbResult);//"de/st/max123"???
@@ -281,7 +285,7 @@ public class InitialSearchTaskFirstTest {
//Mock ZMR
ArrayList<RegisterResult> zmrResult = new ArrayList<>();
- zmrResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "1111-01-01"));
+ zmrResult.add(new RegisterResult("bpkMax","de/st/max123", "Max", "Mustermann", "2011-01-01"));
zmrClient = Mockito.mock(DummyZmrClient.class);
Mockito.when(zmrClient.searchWithPersonIdentifer("max123")).thenReturn(zmrResult);//"de/st/max123"???
@@ -305,13 +309,18 @@ public class InitialSearchTaskFirstTest {
}
}
- @Ignore
@Test
@DirtiesContext
/**
* One match found in ZMR and ErnB with detail search
*/
- public void testNode103() throws Exception {
+ public void testNode103IT() throws Exception {
+ String bpkRegister = "bpkMax";
+ String taxNumber = "tax123";
+ final AuthenticationResponse response = buildDummyAuthResponseMaxMustermannIT_Tax(taxNumber);
+ TestRequestImpl pendingReq1 = new TestRequestImpl();
+ pendingReq1.getSessionData(AuthProcessDataWrapper.class)
+ .setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
//Mock ZMR initial search
ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
@@ -320,10 +329,10 @@ public class InitialSearchTaskFirstTest {
ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
//String bpk, String pseudonym, String givenName, String familyName, String dateOfBirth,
// String placeOfBirth, String birthName, String taxNumber, PostalAddressType address
- zmrResultSpecific.add(new RegisterResult("bpkMax","de/st/max1234", "Max", "Mustermann", "1111-01-01", null, null,
- "tax123", null));
+ zmrResultSpecific.add(new RegisterResult(bpkRegister,"it/st/max1234", "Max", "Mustermann", "2011-01-01", null,
+ null, taxNumber, null));
- Mockito.when(zmrClient.searchItSpecific("tax123")).thenReturn(zmrResultSpecific);
+ Mockito.when(zmrClient.searchItSpecific(taxNumber)).thenReturn(zmrResultSpecific);
task.setZmrClient(zmrClient);
//Mock ernb initial search
@@ -333,24 +342,160 @@ public class InitialSearchTaskFirstTest {
task.setErnbClient(ernbClient);
+ //Mock country specific search
+ List<ICountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
+ ItSpecificDetailSearchProcessor it = new ItSpecificDetailSearchProcessor();
+ it.setErnbClient(ernbClient);
+ it.setZmrClient(zmrClient);
+ handlers.add(it);
+ task.setHandlers(handlers);
+
try {
- task.execute(pendingReq, executionContext);
+ task.execute(pendingReq1, executionContext);
String bPk = (String)
- pendingReq.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
- Assert.assertTrue("Wrong bpk", bPk.equals("bpkMax"));
+ pendingReq1.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
+ Assert.assertTrue("Wrong bpk", bPk.equals(bpkRegister));
+ } catch (final TaskExecutionException e) {
+ Assert.assertTrue("Wrong workflow, should not reach this point", false);
+ }
+ }
+
+ @Test
+ @DirtiesContext
+ /**
+ * Multiple matches found in ZMR and ErnB with detail search
+ */
+ public void testNode103DE() throws Exception {
+ String givenName = "Max";
+ String familyName = "Mustermann";
+ String pseudonym = "de/st/max1234";
+ String bpk = "bpkMax";
+ String dateOfBirth = "2011-01-01";
+ String placeOfBirth = "München";
+ String birthName = "BabyMax";
+ final AuthenticationResponse response = buildDummyAuthResponseDE(givenName, familyName, pseudonym,
+ dateOfBirth, placeOfBirth, birthName);
+ TestRequestImpl pendingReq1 = new TestRequestImpl();
+ pendingReq1.getSessionData(AuthProcessDataWrapper.class)
+ .setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
+
+ //Mock ZMR initial search
+ ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
+ zmrClient = Mockito.mock(DummyZmrClient.class);
+ Mockito.when(zmrClient.searchWithPersonIdentifer("max123")).thenReturn(zmrResultInitial);
+ ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
+
+ zmrResultSpecific.add(new RegisterResult(bpk, pseudonym, givenName, familyName, dateOfBirth, placeOfBirth, birthName,
+ null, null));
+
+ //.searchDeSpecific(eidData.getGivenName(), eidData.getFamilyName(), eidData.getDateOfBirth(),
+ // eidData.getPlaceOfBirth(), eidData.getBirthName()
+ Mockito.when(zmrClient.searchDeSpecific(givenName, familyName, dateOfBirth, placeOfBirth, birthName)).thenReturn(zmrResultSpecific);
+
+ task.setZmrClient(zmrClient);
+
+ //Mock ernb initial search
+ ArrayList<RegisterResult> ernbResultInitial = new ArrayList<>();
+ ernbClient = Mockito.mock(DummyErnbClient.class);
+ Mockito.when(ernbClient.searchWithPersonIdentifer("max123")).thenReturn(ernbResultInitial);//"de/st/max123"???
+
+ task.setErnbClient(ernbClient);
+
+ //Mock country specific search
+ List<ICountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
+ DeSpecificDetailSearchProcessor de = new DeSpecificDetailSearchProcessor();
+ de.setErnbClient(ernbClient);
+ de.setZmrClient(zmrClient);
+ handlers.add(de);
+ task.setHandlers(handlers);
+
+ try {
+ task.execute(pendingReq1, executionContext);
+
+ String bPk = (String)
+ pendingReq1.getSessionData(AuthProcessDataWrapper.class).getGenericDataFromSession(Constants.DATA_RESULT_MATCHING_BPK);
+ Assert.assertTrue("Wrong bpk", bPk.equals(bpk));
} catch (final TaskExecutionException e) {
Assert.assertTrue("Wrong workflow, should not reach this point", false);
}
}
- @Ignore
@Test
@DirtiesContext
/**
* Multiple matches found in ZMR and ErnB with detail search
*/
- public void testNode104() throws Exception {
+ public void testNode104DE() throws Exception {
+ String givenName = "Max";
+ String familyName = "Mustermann";
+ String pseudonym1 = "de/st/max1234";
+ String pseudonym2 = "de/st/max12345";
+ String bpk1 = "bpkMax";
+ String bpk2 = "bpkMax1";
+ String dateOfBirth = "2011-01-01";
+ String placeOfBirth = "München";
+ String birthName = "BabyMax";
+ final AuthenticationResponse response = buildDummyAuthResponseDE(givenName, familyName, pseudonym1,
+ dateOfBirth, placeOfBirth, birthName);
+ TestRequestImpl pendingReq1 = new TestRequestImpl();
+ pendingReq1.getSessionData(AuthProcessDataWrapper.class)
+ .setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
+
+ //Mock ZMR initial search
+ ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
+ zmrClient = Mockito.mock(DummyZmrClient.class);
+ Mockito.when(zmrClient.searchWithPersonIdentifer("max123")).thenReturn(zmrResultInitial);
+ ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
+
+ zmrResultSpecific.add(new RegisterResult(bpk1, pseudonym1, givenName, familyName, dateOfBirth, placeOfBirth, birthName,
+ null, null));
+ zmrResultSpecific.add(new RegisterResult(bpk2, pseudonym2, givenName, familyName, dateOfBirth, placeOfBirth, birthName,
+ null, null));
+ //.searchDeSpecific(eidData.getGivenName(), eidData.getFamilyName(), eidData.getDateOfBirth(),
+ // eidData.getPlaceOfBirth(), eidData.getBirthName()
+ Mockito.when(zmrClient.searchDeSpecific(givenName, familyName, dateOfBirth, placeOfBirth, birthName)).thenReturn(zmrResultSpecific);
+
+ task.setZmrClient(zmrClient);
+
+ //Mock ernb initial search
+ ArrayList<RegisterResult> ernbResultInitial = new ArrayList<>();
+ ernbClient = Mockito.mock(DummyErnbClient.class);
+ Mockito.when(ernbClient.searchWithPersonIdentifer("max123")).thenReturn(ernbResultInitial);//"de/st/max123"???
+
+ task.setErnbClient(ernbClient);
+
+ //Mock country specific search
+ List<ICountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
+ DeSpecificDetailSearchProcessor de = new DeSpecificDetailSearchProcessor();
+ de.setErnbClient(ernbClient);
+ de.setZmrClient(zmrClient);
+ handlers.add(de);
+ task.setHandlers(handlers);
+
+ try {
+ task.execute(pendingReq1, executionContext);
+
+ Assert.assertTrue("Wrong workflow, should not reach this point/ get a bpk", false);
+
+ } catch (final TaskExecutionException e) {
+ Throwable origE = e.getOriginalException();
+ Assert.assertTrue("Wrong exception", (origE.getCause() instanceof ManualFixNecessaryException));
+ }
+ }
+
+ @Test
+ @DirtiesContext
+ /**
+ * Multiple matches found in ZMR and ErnB with detail search
+ */
+ public void testNode104IT() throws Exception {
+
+ String fakeTaxNumber = "tax123";
+ final AuthenticationResponse response = buildDummyAuthResponseMaxMustermannIT_Tax(fakeTaxNumber);
+ TestRequestImpl pendingReq1 = new TestRequestImpl();
+ pendingReq1.getSessionData(AuthProcessDataWrapper.class)
+ .setGenericDataToSession(Constants.DATA_FULL_EIDAS_RESPONSE, response);
//Mock ZMR initial search
ArrayList<RegisterResult> zmrResultInitial = new ArrayList<>();
@@ -359,11 +504,11 @@ public class InitialSearchTaskFirstTest {
ArrayList<RegisterResult> zmrResultSpecific = new ArrayList<>();
//String bpk, String pseudonym, String givenName, String familyName, String dateOfBirth,
// String placeOfBirth, String birthName, String taxNumber, PostalAddressType address
- zmrResultSpecific.add(new RegisterResult("bpkMax","de/st/max1234", "Max", "Mustermann", "1111-01-01", null, null,
- "tax123", null));
- zmrResultSpecific.add(new RegisterResult("bpkMax1","de/st/max1235", "Max", "Mustermann", "1111-01-01", null, null,
- "tax123", null));
- Mockito.when(zmrClient.searchItSpecific("tax123")).thenReturn(zmrResultSpecific);
+ zmrResultSpecific.add(new RegisterResult("bpkMax","it/st/max1234", "Max", "Mustermann", "2011-01-01", null, null,
+ fakeTaxNumber, null));
+ zmrResultSpecific.add(new RegisterResult("bpkMax1","it/st/max1235", "Max", "Mustermann", "2011-01-01", null, null,
+ fakeTaxNumber, null));
+ Mockito.when(zmrClient.searchItSpecific(fakeTaxNumber)).thenReturn(zmrResultSpecific);
task.setZmrClient(zmrClient);
@@ -375,8 +520,16 @@ public class InitialSearchTaskFirstTest {
task.setErnbClient(ernbClient);
+ //Mock country specific search
+ List<ICountrySpecificDetailSearchProcessor> handlers = new ArrayList<>();
+ ItSpecificDetailSearchProcessor it = new ItSpecificDetailSearchProcessor();
+ it.setErnbClient(ernbClient);
+ it.setZmrClient(zmrClient);
+ handlers.add(it);
+ task.setHandlers(handlers);
+
try {
- task.execute(pendingReq, executionContext);
+ task.execute(pendingReq1, executionContext);
Assert.assertTrue("Wrong workflow, should not reach this point/ get a bpk", false);
@@ -386,7 +539,6 @@ public class InitialSearchTaskFirstTest {
}
}
-
@Test
@DirtiesContext
/**
@@ -427,12 +579,35 @@ public class InitialSearchTaskFirstTest {
@NotNull
private AuthenticationResponse buildDummyAuthResponseMaxMustermann() throws URISyntaxException {
return buildDummyAuthResponse("Max", "Mustermann",
- "de/st/max123", "1111-01-01");
+ "de/st/max123", "2011-01-01");
+ }
+
+ private AuthenticationResponse buildDummyAuthResponseMaxMustermannIT() throws URISyntaxException {
+ return buildDummyAuthResponse("Max", "Mustermann",
+ "it/st/max123", "2011-01-01");
+ }
+
+ private AuthenticationResponse buildDummyAuthResponseMaxMustermannIT_Tax(String taxNumber) throws URISyntaxException {
+ return buildDummyAuthResponse("Max", "Mustermann",
+ "it/st/max123", "2011-01-01", taxNumber, null, null);
}
@NotNull
private AuthenticationResponse buildDummyAuthResponse(String givenName, String familyName, String identifier,
String dateOfBirth) throws URISyntaxException {
+ return buildDummyAuthResponse(givenName, familyName, identifier, dateOfBirth, null, null, null);
+ }
+
+ @NotNull
+ private AuthenticationResponse buildDummyAuthResponseDE(String givenName, String familyName, String identifier,
+ String dateOfBirth, String placeOfBirth,
+ String birthName) throws URISyntaxException {
+ return buildDummyAuthResponse(givenName, familyName, identifier, dateOfBirth, null, placeOfBirth, birthName);
+ }
+ @NotNull
+ private AuthenticationResponse buildDummyAuthResponse(String givenName, String familyName, String identifier,
+ String dateOfBirth, String taxNumber, String placeOfBirth,
+ String birthName) throws URISyntaxException {
final AttributeDefinition attributeDef = AttributeDefinition.builder()
.friendlyName(Constants.eIDAS_ATTR_PERSONALIDENTIFIER).nameUri(new URI("ad", "sd", "ff"))
.personType(PersonType.LEGAL_PERSON).xmlType(new QName("http://saf", "as", "af"))
@@ -449,12 +624,34 @@ public class InitialSearchTaskFirstTest {
.friendlyName(Constants.eIDAS_ATTR_DATEOFBIRTH).nameUri(new URI("ad", "sd", "fffff"))
.personType(PersonType.LEGAL_PERSON).xmlType(new QName("http://saf", "as", "affff"))
.attributeValueMarshaller("eu.eidas.auth.commons.attribute.impl.DateTimeAttributeValueMarshaller").build();
-
- final ImmutableAttributeMap attributeMap = ImmutableAttributeMap.builder()
+ final AttributeDefinition attributeDef5 = AttributeDefinition.builder()
+ .friendlyName(Constants.eIDAS_ATTR_TAXREFERENCE).nameUri(new URI("ad", "sd", "ffffff"))
+ .personType(PersonType.LEGAL_PERSON).xmlType(new QName("http://saf", "as", "afffff"))
+ .attributeValueMarshaller("eu.eidas.auth.commons.attribute.impl.LiteralStringAttributeValueMarshaller").build();
+ final AttributeDefinition attributeDef6 = AttributeDefinition.builder()
+ .friendlyName(Constants.eIDAS_ATTR_PLACEOFBIRTH).nameUri(new URI("ad", "sd", "fffffff"))
+ .personType(PersonType.LEGAL_PERSON).xmlType(new QName("http://saf", "as", "affffff"))
+ .attributeValueMarshaller("eu.eidas.auth.commons.attribute.impl.LiteralStringAttributeValueMarshaller").build();
+ final AttributeDefinition attributeDef7 = AttributeDefinition.builder()
+ .friendlyName(Constants.eIDAS_ATTR_BIRTHNAME).nameUri(new URI("ad", "sd", "ffffffff"))
+ .personType(PersonType.LEGAL_PERSON).xmlType(new QName("http://saf", "as", "afffffff"))
+ .attributeValueMarshaller("eu.eidas.auth.commons.attribute.impl.LiteralStringAttributeValueMarshaller").build();
+ ImmutableAttributeMap.Builder builder = ImmutableAttributeMap.builder()
.put(attributeDef, identifier)
.put(attributeDef2, familyName)
.put(attributeDef3, givenName)
- .put(attributeDef4, dateOfBirth).build();
+ .put(attributeDef4, dateOfBirth);
+
+ if(taxNumber != null) {
+ builder.put(attributeDef5, taxNumber);
+ }
+ if(birthName != null) {
+ builder.put(attributeDef7, birthName);
+ }
+ if(placeOfBirth != null) {
+ builder.put(attributeDef6, placeOfBirth);
+ }
+ final ImmutableAttributeMap attributeMap = builder.build();
val b = new AuthenticationResponse.Builder();
return b.id("aasdf").issuer("asd").subject("asf").statusCode("200").inResponseTo("asdf").subjectNameIdFormat(
diff --git a/eidas_modules/authmodule-eIDAS-v2/src/test/resources/SpringTest-context_tasks_test.xml b/eidas_modules/authmodule-eIDAS-v2/src/test/resources/SpringTest-context_tasks_test.xml
index 17e32b86..cde374a1 100644
--- a/eidas_modules/authmodule-eIDAS-v2/src/test/resources/SpringTest-context_tasks_test.xml
+++ b/eidas_modules/authmodule-eIDAS-v2/src/test/resources/SpringTest-context_tasks_test.xml
@@ -74,4 +74,11 @@
<bean id="ZmrClientForeIDAS"
class="at.asitplus.eidas.specific.modules.auth.eidas.v2.zmr.DummyZmrClient" />
+ <bean id="DE-Specific-Search"
+ class="at.asitplus.eidas.specific.modules.auth.eidas.v2.handler.DeSpecificDetailSearchProcessor">
+ </bean>
+
+ <bean id="IT-Specific-Search"
+ class="at.asitplus.eidas.specific.modules.auth.eidas.v2.handler.ItSpecificDetailSearchProcessor">
+ </bean>
</beans> \ No newline at end of file