aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-module-ehvd_integration/src/test
diff options
context:
space:
mode:
authorThomas Lenz <thomas.lenz@egiz.gv.at>2021-07-30 09:16:47 +0200
committerThomas Lenz <thomas.lenz@egiz.gv.at>2021-08-30 10:38:25 +0200
commit7abe41afdb6f454e02126dbc90fb0352d0d15f74 (patch)
treea59db3d7116e9e51967507240129f7301bab8318 /id/server/modules/moa-id-module-ehvd_integration/src/test
parent56af7bee462d70f08d0442254c632f39e50ec96f (diff)
downloadmoa-id-spss-7abe41afdb6f454e02126dbc90fb0352d0d15f74.tar.gz
moa-id-spss-7abe41afdb6f454e02126dbc90fb0352d0d15f74.tar.bz2
moa-id-spss-7abe41afdb6f454e02126dbc90fb0352d0d15f74.zip
throw a specific error in case of a EHVD response that contains no GDA information
Diffstat (limited to 'id/server/modules/moa-id-module-ehvd_integration/src/test')
-rw-r--r--id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationQsSystemTest.java4
-rw-r--r--id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationTaskTest.java17
2 files changed, 19 insertions, 2 deletions
diff --git a/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationQsSystemTest.java b/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationQsSystemTest.java
index 585083a77..e77e2db58 100644
--- a/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationQsSystemTest.java
+++ b/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationQsSystemTest.java
@@ -120,8 +120,8 @@ public class InjectEhvdIdentityInformationQsSystemTest {
final AuthenticationSessionWrapper moaSession = pendingReq.getSessionData(
AuthenticationSessionWrapper.class);
moaSession.setIdentityLink(TestUtils.generateDummyIdl(
- RandomStringUtils.randomAlphanumeric(10),
- EAAFConstants.URN_PREFIX_BASEID));
+ "SUTFhJ/FXHmLGfTFchYnnWG/e3A=",
+ EAAFConstants.URN_PREFIX_CDID + "GH"));
task.execute(pendingReq, context);
diff --git a/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationTaskTest.java b/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationTaskTest.java
index 0c84a7bcf..8620ef98b 100644
--- a/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationTaskTest.java
+++ b/id/server/modules/moa-id-module-ehvd_integration/src/test/java/at/gv/egovernment/moa/id/auth/modules/ehvd/test/tasks/InjectEhvdIdentityInformationTaskTest.java
@@ -197,6 +197,23 @@ public class InjectEhvdIdentityInformationTaskTest {
}
@Test
+ public void noGdaInfosInResponse() throws TaskExecutionException, PendingReqIdValidationException {
+ // set-up EHVD response
+ GdaIndexResponse gdaResponse = new GdaIndexResponse();
+ when(ehvdService.getGDA(any())).thenReturn(gdaResponse);
+
+ try {
+ task.execute(pendingReq, context);
+ fail("wrong state not detected");
+
+ } catch (final TaskExecutionException e) {
+ Assert.isInstanceOf(AuthenticationException.class, e.getOriginalException(), "wrong execpetion");
+ assertEquals("wrong errorCode", "ehvd.03", ((EAAFException) e.getOriginalException()).getErrorId());
+
+ }
+ }
+
+ @Test
public void validateState() throws TaskExecutionException, PendingReqIdValidationException {
// set-up EHVD response
String role1 = RandomStringUtils.randomAlphabetic(10);