[java-idp-oidc] 04/04: Minor test improvements.

Henri Mikkonen henri.mikkonen at iki.fi
Thu Dec 30 14:51:12 UTC 2021


This is an automated email from the git hooks/post-receive script.

hjmikkon pushed a commit to branch maint-3.0
in repository java-idp-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-oidc.git;a=commit;h=0254f05747b263e55797a5e4e78cc22215a3d84f

commit 0254f05747b263e55797a5e4e78cc22215a3d84f
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Thu Dec 30 16:50:59 2021 +0200

    Minor test improvements.
---
 .../impl/ValidateEndpointAuthenticationTest.java   | 24 +++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/ValidateEndpointAuthenticationTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/ValidateEndpointAuthenticationTest.java
index 18562cf0..bf8cacf4 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/ValidateEndpointAuthenticationTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/ValidateEndpointAuthenticationTest.java
@@ -228,7 +228,29 @@ public class ValidateEndpointAuthenticationTest {
                 audValidator, jitValidator));
         return claimsValidation;
     }
-    
+
+    @Test(expectedExceptions = ComponentInitializationException.class)
+    public void testNoReplayCache_initFails() throws ComponentInitializationException {
+        ValidateEndpointAuthentication action = new ValidateEndpointAuthentication();
+        action.setClaimsValidation(constructClaimsValidation(new MockHttpServletRequest(), new ReplayCache()));
+        action.initialize();
+    }
+
+    @Test(expectedExceptions = ComponentInitializationException.class)
+    public void testNoClaimsValidation_initFails() throws ComponentInitializationException {
+        ValidateEndpointAuthentication action = new ValidateEndpointAuthentication();
+        action.setReplayCache(new ReplayCache());
+        action.initialize();
+    }
+
+    @Test
+    public void testInitSuccess() throws ComponentInitializationException {
+        ValidateEndpointAuthentication action = new ValidateEndpointAuthentication();
+        action.setReplayCache(new ReplayCache());
+        action.setClaimsValidation(constructClaimsValidation(new MockHttpServletRequest(), new ReplayCache()));
+        action.initialize();
+    }
+
     @Test
     public void testNoEnabledMethods() throws Exception {
         ValidateEndpointAuthentication action = constructAction(null);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list