[java-idp-oidc] branch master updated: Unit test fixes.

Scott Cantor cantor.2 at osu.edu
Thu Jan 9 21:07:09 EST 2020


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

scantor pushed a commit to branch master
in repository java-idp-oidc.

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

The following commit(s) were added to refs/heads/master by this push:
       new  f38178c   Unit test fixes.
f38178c is described below

commit f38178cf7ac5b30e6672a7ea44e4453d7ff3d2bf
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jan 9 21:07:06 2020 -0500

    Unit test fixes.
---
 .../matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java      | 2 +-
 .../idpextension/oidc/config/OIDCCoreProtocolConfiguration.java  | 4 ++++
 .../oidc/profile/impl/InitializeAuthenticationContextTest.java   | 9 +++++----
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java b/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java
index e4097a0..e94fa87 100644
--- a/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java
+++ b/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/attribute/filter/matcher/impl/AttributeInOIDCRequestedClaimsMatcher.java
@@ -158,7 +158,7 @@ public class AttributeInOIDCRequestedClaimsMatcher extends AbstractIdentifiableI
                 return Set.copyOf(attribute.getValues());
             } else {
                 log.debug("{} none of the values matched as not silent mode", getLogPrefix());
-                return Collections.emptySet();
+                return null;
             }
         }
         
diff --git a/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/config/OIDCCoreProtocolConfiguration.java b/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/config/OIDCCoreProtocolConfiguration.java
index 59d0bd1..73ff989 100644
--- a/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/config/OIDCCoreProtocolConfiguration.java
+++ b/idp-oidc-extension-impl/src/main/java/org/geant/idpextension/oidc/config/OIDCCoreProtocolConfiguration.java
@@ -126,6 +126,10 @@ public class OIDCCoreProtocolConfiguration extends AbstractOIDCFlowAwareProfileC
         acrRequestAlwaysEssentialPredicate = Predicates.alwaysFalse();
         forcePKCEPredicate = Predicates.alwaysFalse();
         allowPKCEPlainPredicate = Predicates.alwaysFalse();
+        
+        defaultAuthenticationContextsLookupStrategy = FunctionSupport.constant(null);
+        authenticationFlowsLookupStrategy = FunctionSupport.constant(null);
+        postAuthenticationFlowsLookupStrategy = FunctionSupport.constant(null);
     }
     
     /**
diff --git a/idp-oidc-extension-impl/src/test/java/org/geant/idpextension/oidc/profile/impl/InitializeAuthenticationContextTest.java b/idp-oidc-extension-impl/src/test/java/org/geant/idpextension/oidc/profile/impl/InitializeAuthenticationContextTest.java
index cf2d5c3..9d3eaeb 100644
--- a/idp-oidc-extension-impl/src/test/java/org/geant/idpextension/oidc/profile/impl/InitializeAuthenticationContextTest.java
+++ b/idp-oidc-extension-impl/src/test/java/org/geant/idpextension/oidc/profile/impl/InitializeAuthenticationContextTest.java
@@ -24,6 +24,7 @@ import net.shibboleth.utilities.java.support.component.ComponentInitializationEx
 import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
 
 import java.net.URI;
+import java.time.Duration;
 
 import javax.security.auth.Subject;
 
@@ -73,14 +74,14 @@ public class InitializeAuthenticationContextTest {
      * Test forced, hinted name.
      */
     @Test
-    public void testOIDCAuthnRequestForcedWithHintedName() throws Exception {
+    public void testOIDCAuthnRequestForcedWithHintedName() {
         final Event event = action.execute(requestCtx);
         ActionTestingSupport.assertProceedEvent(event);
         final AuthenticationContext authnCtx = prc.getSubcontext(AuthenticationContext.class);
         Assert.assertNotNull(authnCtx);
         Assert.assertTrue(authnCtx.isForceAuthn());
         Assert.assertFalse(authnCtx.isPassive());
-        Assert.assertEquals(authnCtx.getMaxAge(), 0);
+        Assert.assertNull(authnCtx.getMaxAge());
         Assert.assertEquals(authnCtx.getHintedName(), "foo");
     }
 
@@ -88,7 +89,7 @@ public class InitializeAuthenticationContextTest {
      * Test passive max 5s
      */
     @Test
-    public void testOIDCAuthnRequestPassive() throws Exception {
+    public void testOIDCAuthnRequestPassive() {
         final AuthenticationRequest req = new AuthenticationRequest.Builder(new ResponseType("code"), new Scope("openid"),
                 new ClientID("000123"), URI.create("https://example.com/callback")).state(new State())
                         .prompt(new Prompt(Prompt.Type.NONE)).maxAge(5).build();
@@ -99,7 +100,7 @@ public class InitializeAuthenticationContextTest {
         Assert.assertNotNull(authnCtx);
         Assert.assertFalse(authnCtx.isForceAuthn());
         Assert.assertTrue(authnCtx.isPassive());
-        Assert.assertEquals(authnCtx.getMaxAge(), 5000);
+        Assert.assertEquals(authnCtx.getMaxAge(), Duration.ofSeconds(5));
     }
 
     @Test(expectedExceptions = ConstraintViolationException.class)

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


More information about the commits mailing list