[java-identity-provider] branch master updated: Guava replacement.

Scott Cantor cantor.2 at osu.edu
Tue Jul 7 14:30:16 UTC 2020


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

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=167355cb35815afd62416102209ebc1630d59b0a

The following commit(s) were added to refs/heads/master by this push:
       new  167355cb3 Guava replacement.
167355cb3 is described below

commit 167355cb35815afd62416102209ebc1630d59b0a
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Jul 7 10:30:20 2020 -0400

    Guava replacement.
---
 .../shibboleth/idp/authn/AuthenticationResult.java |  6 ++--
 .../AuthenticationFlowsLookupFunction.java         |  5 +--
 .../PostAuthenticationFlowsLookupFunction.java     |  5 +--
 ...PopulateSubjectCanonicalizationContextTest.java | 12 +++----
 .../authn/impl/SelectAuthenticationFlowTest.java   | 13 ++++----
 .../DynamicHTTPMetadataProviderParserTest.java     |  7 ++--
 .../ProcessAssertionsForAuthenticationTest.java    | 37 +++++++++++-----------
 .../session/impl/StorageBackedSessionManager.java  |  9 +++---
 8 files changed, 43 insertions(+), 51 deletions(-)

diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java
index dd9809adc..c471955c3 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/AuthenticationResult.java
@@ -42,12 +42,9 @@ import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.annotation.constraint.NotLive;
 import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 import net.shibboleth.utilities.java.support.logic.Constraint;
-import net.shibboleth.utilities.java.support.logic.PredicateSupport;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 
 import com.google.common.base.MoreObjects;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableSet;
 
 /**
  * Describes an act of authentication.
@@ -106,7 +103,8 @@ public class AuthenticationResult implements PrincipalSupportingComponent {
      * @param principal a Principal identifying the authenticated entity
      */
     public AuthenticationResult(@Nonnull @NotEmpty final String flowId, @Nonnull final Principal principal) {
-        this(flowId, new Subject(false, ImmutableSet.of(Constraint.isNotNull(principal, "Principal cannot be null")),
+        this(flowId, new Subject(false,
+                Collections.singleton(Constraint.isNotNull(principal, "Principal cannot be null")),
                 Collections.emptySet(), Collections.emptySet()));
     }
     
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java
index 6f47cb0ee..1195eca47 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/AuthenticationFlowsLookupFunction.java
@@ -32,8 +32,6 @@ import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 
 import org.opensaml.profile.context.ProfileRequestContext;
 
-import com.google.common.collect.ImmutableList;
-
 /**
  * A function that returns {@link AuthenticationProfileConfiguration#getAuthenticationFlows}()
  * if such a profile is available from a {@link RelyingPartyContext} obtained via a lookup function,
@@ -51,8 +49,7 @@ public class AuthenticationFlowsLookupFunction extends AbstractRelyingPartyLooku
         if (rpc != null) {
             final ProfileConfiguration pc = rpc.getProfileConfig();
             if (pc != null && pc instanceof AuthenticationProfileConfiguration) {
-                return ImmutableList.<String>copyOf(
-                        ((AuthenticationProfileConfiguration) pc).getAuthenticationFlows(input));
+                return ((AuthenticationProfileConfiguration) pc).getAuthenticationFlows(input);
             }
         }
         
diff --git a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java
index 886dd8741..1af85b159 100644
--- a/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java
+++ b/idp-authn-api/src/main/java/net/shibboleth/idp/authn/config/navigate/PostAuthenticationFlowsLookupFunction.java
@@ -32,8 +32,6 @@ import net.shibboleth.utilities.java.support.annotation.constraint.Unmodifiable;
 
 import org.opensaml.profile.context.ProfileRequestContext;
 
-import com.google.common.collect.ImmutableList;
-
 /**
  * A function that returns {@link AuthenticationProfileConfiguration#getPostAuthenticationFlows}()
  * if such a profile is available from a {@link RelyingPartyContext} obtained via a lookup function,
@@ -51,8 +49,7 @@ public class PostAuthenticationFlowsLookupFunction extends AbstractRelyingPartyL
         if (rpc != null) {
             final ProfileConfiguration pc = rpc.getProfileConfig();
             if (pc != null && pc instanceof AuthenticationProfileConfiguration) {
-                return ImmutableList.<String>copyOf(
-                        ((AuthenticationProfileConfiguration) pc).getPostAuthenticationFlows(input));
+                return ((AuthenticationProfileConfiguration) pc).getPostAuthenticationFlows(input);
             }
         }
         
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java
index 70d4ab7bc..8d4bd307b 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/PopulateSubjectCanonicalizationContextTest.java
@@ -17,6 +17,8 @@
 
 package net.shibboleth.idp.authn.impl;
 
+import java.util.List;
+
 import javax.security.auth.Subject;
 
 import net.shibboleth.idp.authn.SubjectCanonicalizationFlowDescriptor;
@@ -31,12 +33,10 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import com.google.common.collect.ImmutableList;
-
 /** {@link PopulateSubjectCanonicalizationContext} unit test and base class for further action tests. */
 public class PopulateSubjectCanonicalizationContextTest {
 
-    protected ImmutableList<SubjectCanonicalizationFlowDescriptor> c14nFlows;
+    protected List<SubjectCanonicalizationFlowDescriptor> c14nFlows;
 
     protected RequestContext src;
     
@@ -47,13 +47,13 @@ public class PopulateSubjectCanonicalizationContextTest {
         prc = new WebflowRequestContextProfileRequestContextLookup().apply(src);
         prc.getSubcontext(SubjectCanonicalizationContext.class, true).setSubject(new Subject());
 
-        c14nFlows = ImmutableList.of(new SubjectCanonicalizationFlowDescriptor(),
+        c14nFlows = List.of(new SubjectCanonicalizationFlowDescriptor(),
                 new SubjectCanonicalizationFlowDescriptor(), new SubjectCanonicalizationFlowDescriptor());
         c14nFlows.get(0).setId("test1");
         c14nFlows.get(1).setId("test2");
         c14nFlows.get(2).setId("test3");
 
-        PopulateSubjectCanonicalizationContext action = new PopulateSubjectCanonicalizationContext();
+        final PopulateSubjectCanonicalizationContext action = new PopulateSubjectCanonicalizationContext();
         action.setAvailableFlows(c14nFlows);
         action.initialize();
 
@@ -68,7 +68,7 @@ public class PopulateSubjectCanonicalizationContextTest {
     @Test public void testAction() throws Exception {
         
         ActionTestingSupport.assertProceedEvent(prc);
-        SubjectCanonicalizationContext c14nCtx = prc.getSubcontext(SubjectCanonicalizationContext.class, false);
+        final SubjectCanonicalizationContext c14nCtx = prc.getSubcontext(SubjectCanonicalizationContext.class, false);
         Assert.assertNotNull(c14nCtx);
 
         Assert.assertEquals(c14nCtx.getPotentialFlows().size(), 3);
diff --git a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java
index ba000a207..66c0c5e4e 100644
--- a/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java
+++ b/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/impl/SelectAuthenticationFlowTest.java
@@ -19,6 +19,7 @@ package net.shibboleth.idp.authn.impl;
 
 import java.security.Principal;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import javax.security.auth.Subject;
@@ -38,8 +39,6 @@ import org.testng.Assert;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import com.google.common.collect.ImmutableList;
-
 /** {@link SelectAuthenticationFlow} unit test. */
 public class SelectAuthenticationFlowTest extends BaseAuthenticationContextTest {
     
@@ -161,7 +160,7 @@ public class SelectAuthenticationFlowTest extends BaseAuthenticationContextTest
         final AuthenticationResult active = new AuthenticationResult("test1", new Subject());
         active.getSubject().getPrincipals().add(new TestPrincipal("test1"));
         authCtx.setActiveResults(Arrays.asList(active));
-        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));
+        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(Collections.singletonList(principals.get(0)));
         
         final Event event = action.execute(src);
         
@@ -181,7 +180,7 @@ public class SelectAuthenticationFlowTest extends BaseAuthenticationContextTest
         active1.getSubject().getPrincipals().add(new TestPrincipal("test1"));
         active3.getSubject().getPrincipals().add(new TestPrincipal("test3"));
         authCtx.setActiveResults(Arrays.asList(active1, active3));
-        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));
+        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(Collections.singletonList(principals.get(0)));
         
         final Event event = action.execute(src);
         
@@ -241,7 +240,7 @@ public class SelectAuthenticationFlowTest extends BaseAuthenticationContextTest
         final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
         active.getSubject().getPrincipals().add(new TestPrincipal("test2"));
         authCtx.setActiveResults(Arrays.asList(active));
-        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));
+        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(Collections.singletonList(principals.get(0)));
         
         final Event event = action.execute(src);
         ActionTestingSupport.assertEvent(event, "test3");
@@ -263,7 +262,7 @@ public class SelectAuthenticationFlowTest extends BaseAuthenticationContextTest
         final AuthenticationResult active = new AuthenticationResult("test3", new Subject());
         active.getSubject().getPrincipals().add(new TestPrincipal("test3"));
         authCtx.setActiveResults(Arrays.asList(active));
-        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));
+        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(Collections.singletonList(principals.get(0)));
         
         final Event event = action.execute(src);
         
@@ -284,7 +283,7 @@ public class SelectAuthenticationFlowTest extends BaseAuthenticationContextTest
         final AuthenticationResult active = new AuthenticationResult("test2", new Subject());
         active.getSubject().getPrincipals().add(new TestPrincipal("test2"));
         authCtx.setActiveResults(Arrays.asList(active));
-        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(ImmutableList.of(principals.get(0)));
+        authCtx.getPotentialFlows().get("test3").setSupportedPrincipals(Collections.singletonList(principals.get(0)));
         
         action = new SelectAuthenticationFlow();
         action.setFavorSSO(true);
diff --git a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
index 723683595..95f00c205 100644
--- a/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
+++ b/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/DynamicHTTPMetadataProviderParserTest.java
@@ -22,6 +22,7 @@ import java.security.SecureRandom;
 import java.time.Duration;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.List;
 import java.util.function.Function;
 import java.util.function.Predicate;
 
@@ -41,8 +42,6 @@ import org.springframework.mock.env.MockPropertySource;
 import org.testng.Assert;
 import org.testng.annotations.Test;
 
-import com.google.common.collect.Lists;
-
 import net.shibboleth.utilities.java.support.repository.RepositorySupport;
 import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
 
@@ -251,7 +250,7 @@ public class DynamicHTTPMetadataProviderParserTest extends AbstractMetadataParse
         final FunctionDrivenDynamicHTTPMetadataResolver resolver = getBean(FunctionDrivenDynamicHTTPMetadataResolver.class, 
                 "dynamicMetadataQueryProtocol.xml", "beans.xml");
         
-        Assert.assertEquals(resolver.getSupportedContentTypes(), Lists.newArrayList("application/samlmetadata+xml"));
+        Assert.assertEquals(resolver.getSupportedContentTypes(), Collections.singletonList("application/samlmetadata+xml"));
 
         final String entityID = "https://foo1.example.org/idp/shibboleth";
         
@@ -267,7 +266,7 @@ public class DynamicHTTPMetadataProviderParserTest extends AbstractMetadataParse
         final FunctionDrivenDynamicHTTPMetadataResolver resolver = getBean(FunctionDrivenDynamicHTTPMetadataResolver.class,
                 "dynamicMetadataQueryProtocolWithContentTypeOverride.xml", "beans.xml");
 
-        Assert.assertEquals(resolver.getSupportedContentTypes(), Lists.newArrayList("application/xml", "test/foo"));
+        Assert.assertEquals(resolver.getSupportedContentTypes(), List.of("application/xml", "test/foo"));
 
         // Note we can't actually execute the request as the test MDQ server only supports application/samlmetadata+xml
     }
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
index 8a052b50c..c803766b9 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessAssertionsForAuthenticationTest.java
@@ -19,6 +19,8 @@ package net.shibboleth.idp.saml.saml2.profile.impl;
 
 import java.time.Duration;
 import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
 import java.util.function.Function;
 
 import org.opensaml.core.OpenSAMLInitBaseTestCase;
@@ -44,7 +46,6 @@ import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import com.google.common.base.Predicates;
-import com.google.common.collect.Lists;
 
 import net.shibboleth.idp.authn.AuthnEventIds;
 import net.shibboleth.idp.authn.context.AuthenticationContext;
@@ -96,7 +97,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion1.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion1.getAuthnStatements().get(0));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test
@@ -110,7 +111,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList());
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.emptyList());
     }
     
     @Test
@@ -124,7 +125,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList());
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.emptyList());
     }
     
     @Test
@@ -140,7 +141,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion1.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion1.getAuthnStatements().get(0));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1, assertion2));
+        Assert.assertEquals(samlResponse.getAssertions(), List.of(assertion1, assertion2));
     }
     
     @Test
@@ -158,7 +159,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion2.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion2.getAuthnStatements().get(0));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1, assertion2));
+        Assert.assertEquals(samlResponse.getAssertions(), List.of(assertion1, assertion2));
     }
     
     @Test
@@ -178,7 +179,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion2.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion2.getAuthnStatements().get(0));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion2, assertion4));
+        Assert.assertEquals(samlResponse.getAssertions(), List.of(assertion2, assertion4));
     }
     
     @Test
@@ -197,7 +198,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion1.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion1.getAuthnStatements().get(0));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1, assertion2));
+        Assert.assertEquals(samlResponse.getAssertions(), List.of(assertion1, assertion2));
     }
     
     @Test
@@ -212,7 +213,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion1.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion1.getAuthnStatements().get(0));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test
@@ -228,7 +229,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion1.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion1.getAuthnStatements().get(1));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test
@@ -245,7 +246,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertSame(samlAuthnContext.getSubject(), assertion1.getSubject());
         Assert.assertSame(samlAuthnContext.getAuthnStatement(), assertion1.getAuthnStatements().get(0));
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test
@@ -258,7 +259,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList());
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.emptyList());
     }
     
     @Test
@@ -269,7 +270,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList());
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.emptyList());
     }
     
     @Test
@@ -285,7 +286,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test
@@ -299,7 +300,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList());
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.emptyList());
     }
     
     @Test
@@ -314,7 +315,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test
@@ -330,7 +331,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertEvent(prc, AuthnEventIds.INVALID_CREDENTIALS);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test
@@ -346,7 +347,7 @@ public class ProcessAssertionsForAuthenticationTest extends OpenSAMLInitBaseTest
         ActionTestingSupport.assertProceedEvent(prc);
         Assert.assertNull(samlAuthnContext.getSubject());
         Assert.assertNull(samlAuthnContext.getAuthnStatement());
-        Assert.assertEquals(samlResponse.getAssertions(), Lists.newArrayList(assertion1));
+        Assert.assertEquals(samlResponse.getAssertions(), Collections.singletonList(assertion1));
     }
     
     @Test(expectedExceptions = ComponentInitializationException.class)
diff --git a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java
index d30758e20..3bfa3c0ef 100644
--- a/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java
+++ b/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/StorageBackedSessionManager.java
@@ -20,6 +20,7 @@ package net.shibboleth.idp.session.impl;
 import java.io.IOException;
 import java.time.Duration;
 import java.time.Instant;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -591,7 +592,7 @@ public class StorageBackedSessionManager extends AbstractIdentifiableInitializab
                             if (cookieName.equals(cookie.getName())) {
                                 final IdPSession session = lookupBySessionId(cookie.getValue());
                                 if (session != null) {
-                                    return ImmutableList.of(session);
+                                    return Collections.singletonList(session);
                                 }
                             }
                         }
@@ -605,9 +606,9 @@ public class StorageBackedSessionManager extends AbstractIdentifiableInitializab
             if (sessionIdCriterion != null) {
                 final IdPSession session = lookupBySessionId(sessionIdCriterion.getSessionId());
                 if (session != null) {
-                    return ImmutableList.of(session);
+                    return Collections.singletonList(session);
                 }
-                return ImmutableList.of();
+                return Collections.emptyList();
             }
 
             final SPSessionCriterion serviceCriterion = criteria.get(SPSessionCriterion.class);
@@ -866,7 +867,7 @@ public class StorageBackedSessionManager extends AbstractIdentifiableInitializab
 
         if (sessionList == null) {
             log.debug("Secondary lookup failed on service ID {} and key {}", serviceId, serviceKey);
-            return ImmutableList.of();
+            return Collections.emptyList();
         }
 
         final ImmutableList.Builder<IdPSession> builder = ImmutableList.builder();

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


More information about the commits mailing list