[java-shib-attribute] branch main updated: Removing additional Guava dependencies.
Scott Cantor
cantor.2 at osu.edu
Thu Apr 20 13:18:04 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-shib-attribute.
View the commit online:
http://git.shibboleth.net/view/?p=java-shib-attribute.git;a=commit;h=4813a656d90b839362ce52c55e6b8c8b66d6d7ad
The following commit(s) were added to refs/heads/main by this push:
new 4813a656d Removing additional Guava dependencies.
4813a656d is described below
commit 4813a656d90b839362ce52c55e6b8c8b66d6d7ad
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Apr 20 09:18:02 2023 -0400
Removing additional Guava dependencies.
---
.../filter/matcher/logic/impl/AndMatcherTest.java | 10 +++++-----
.../filter/matcher/logic/impl/NotMatcherTest.java | 8 ++++----
.../filter/matcher/logic/impl/OrMatcherTest.java | 20 +++++++++-----------
.../impl/AttributeTranscoderRegistryImplTest.java | 8 ++++----
.../attribute/resolver/AbstractResolverPlugin.java | 5 ++---
.../resolver/AbstractResolverPluginTest.java | 5 +----
6 files changed, 25 insertions(+), 31 deletions(-)
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
index b840dc9c9..12b456eb0 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
@@ -18,7 +18,6 @@
package net.shibboleth.idp.attribute.filter.matcher.logic.impl;
import static com.google.common.base.Predicates.equalTo;
-import static com.google.common.base.Predicates.or;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
@@ -41,6 +40,7 @@ import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
+import net.shibboleth.shared.logic.PredicateSupport;
/** {@link AndMatcher} unit test. */
@SuppressWarnings("javadoc")
@@ -52,7 +52,7 @@ public class AndMatcherTest extends AbstractMatcherPolicyRuleTest {
@Test public void testSingleton() throws Exception {
final AndMatcher matcher =
- newAndMatcher(CollectionSupport.singletonList((Matcher) new MockValuePredicateMatcher(or(equalTo(value1),
+ newAndMatcher(CollectionSupport.singletonList((Matcher) new MockValuePredicateMatcher(PredicateSupport.or(equalTo(value1),
equalTo(value2)))));
matcher.setId("test");
@@ -69,8 +69,8 @@ public class AndMatcherTest extends AbstractMatcherPolicyRuleTest {
@Test public void testGetMatchingValues() throws Exception {
final AndMatcher matcher =
newAndMatcher(CollectionSupport.arrayAsList(
- new MockValuePredicateMatcher(or(equalTo(value1), equalTo(value2))),
- new MockValuePredicateMatcher(or(equalTo(value2), equalTo(value3)))));
+ new MockValuePredicateMatcher(PredicateSupport.or(equalTo(value1), equalTo(value2))),
+ new MockValuePredicateMatcher(PredicateSupport.or(equalTo(value2), equalTo(value3)))));
try {
matcher.getMatchingValues(attribute, filterContext);
@@ -122,7 +122,7 @@ public class AndMatcherTest extends AbstractMatcherPolicyRuleTest {
@Test public void emptyResults() throws ComponentInitializationException {
final AndMatcher matcher =
newAndMatcher(CollectionSupport.arrayAsList(
- new MockValuePredicateMatcher(or(equalTo(value1), equalTo(value2))),
+ new MockValuePredicateMatcher(PredicateSupport.or(equalTo(value1), equalTo(value2))),
new MockValuePredicateMatcher(equalTo(value3))));
matcher.setId("Test");
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java
index 3ffa20f45..24c85f6fa 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java
@@ -18,10 +18,8 @@
package net.shibboleth.idp.attribute.filter.matcher.logic.impl;
import static com.google.common.base.Predicates.equalTo;
-import static com.google.common.base.Predicates.or;
import static org.testng.Assert.*;
-import java.util.Arrays;
import java.util.Set;
import javax.annotation.Nonnull;
@@ -33,9 +31,11 @@ import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.filter.Matcher;
import net.shibboleth.idp.attribute.filter.matcher.impl.AbstractMatcherPolicyRuleTest;
import net.shibboleth.idp.attribute.filter.matcher.impl.MockValuePredicateMatcher;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
+import net.shibboleth.shared.logic.PredicateSupport;
/** Test the {@link NotMatcher} matcher. */
@SuppressWarnings("javadoc")
@@ -72,7 +72,7 @@ public class NotMatcherTest extends AbstractMatcherPolicyRuleTest {
}
@Test public void testGetMatchingValues() throws Exception {
- NotMatcher matcher = newNotMatcher(new MockValuePredicateMatcher(or(equalTo(value1), equalTo(value2))));
+ NotMatcher matcher = newNotMatcher(new MockValuePredicateMatcher(PredicateSupport.or(equalTo(value1), equalTo(value2))));
matcher.setId("test");
matcher.initialize();
@@ -89,7 +89,7 @@ public class NotMatcherTest extends AbstractMatcherPolicyRuleTest {
}
final OrMatcher orMatcher =
- OrMatcherTest.newOrMatcher(Arrays.<Matcher>asList(new MockValuePredicateMatcher(equalTo(value1)),
+ OrMatcherTest.newOrMatcher(CollectionSupport.listOf(new MockValuePredicateMatcher(equalTo(value1)),
new MockValuePredicateMatcher(equalTo(value2)), new MockValuePredicateMatcher(equalTo(value3))));
orMatcher.setId("or");
diff --git a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
index 51b507fba..04dfb5726 100644
--- a/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
+++ b/shib-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
@@ -18,10 +18,8 @@
package net.shibboleth.idp.attribute.filter.matcher.logic.impl;
import static com.google.common.base.Predicates.equalTo;
-import static com.google.common.base.Predicates.or;
import static org.testng.Assert.*;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -32,16 +30,16 @@ import javax.annotation.Nonnull;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import com.google.common.base.Predicates;
-
import net.shibboleth.idp.attribute.IdPAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.filter.Matcher;
import net.shibboleth.idp.attribute.filter.matcher.impl.AbstractMatcherPolicyRuleTest;
import net.shibboleth.idp.attribute.filter.matcher.impl.MockValuePredicateMatcher;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.component.DestroyedComponentException;
import net.shibboleth.shared.component.UninitializedComponentException;
+import net.shibboleth.shared.logic.PredicateSupport;
/** {@link OrMatcher} unit test. */
@SuppressWarnings("javadoc")
@@ -53,7 +51,7 @@ public class OrMatcherTest extends AbstractMatcherPolicyRuleTest {
@Test public void testSingleton() throws Exception {
final OrMatcher matcher =
- newOrMatcher(Collections.singletonList((Matcher) new MockValuePredicateMatcher(or(equalTo(value1),
+ newOrMatcher(Collections.singletonList((Matcher) new MockValuePredicateMatcher(PredicateSupport.or(equalTo(value1),
equalTo(value2)))));
matcher.setId("test");
@@ -70,8 +68,8 @@ public class OrMatcherTest extends AbstractMatcherPolicyRuleTest {
@Test public void testGetMatchingValues() throws Exception {
OrMatcher matcher =
- newOrMatcher(Arrays.<Matcher>asList(
- new MockValuePredicateMatcher(or(equalTo(value1), equalTo(value2))),
+ newOrMatcher(CollectionSupport.listOf(
+ new MockValuePredicateMatcher(PredicateSupport.or(equalTo(value1), equalTo(value2))),
new MockValuePredicateMatcher(equalTo(value2))));
try {
@@ -109,8 +107,8 @@ public class OrMatcherTest extends AbstractMatcherPolicyRuleTest {
@Test public void testRegressionGetValues() throws ComponentInitializationException {
final OrMatcher matcher =
- newOrMatcher(Arrays.asList(new MockValuePredicateMatcher(Predicates.alwaysFalse()),
- new MockValuePredicateMatcher(Predicates.alwaysFalse()), new MockValuePredicateMatcher(
+ newOrMatcher(CollectionSupport.listOf(new MockValuePredicateMatcher(PredicateSupport.alwaysFalse()),
+ new MockValuePredicateMatcher(PredicateSupport.alwaysFalse()), new MockValuePredicateMatcher(
equalTo(value1)), new MockValuePredicateMatcher(equalTo(value2))));
matcher.setId("Test");
matcher.initialize();
@@ -128,7 +126,7 @@ public class OrMatcherTest extends AbstractMatcherPolicyRuleTest {
final Predicate<IdPAttributeValue> p = equalTo(StringAttributeValue.valueOf("Nothing"));
final Predicate<IdPAttributeValue> q = equalTo(StringAttributeValue.valueOf("Zippo"));
final OrMatcher matcher =
- newOrMatcher(Arrays.asList(new MockValuePredicateMatcher(p), new MockValuePredicateMatcher(q)));
+ newOrMatcher(CollectionSupport.listOf(new MockValuePredicateMatcher(p), new MockValuePredicateMatcher(q)));
matcher.setId("Test");
matcher.initialize();
@@ -140,7 +138,7 @@ public class OrMatcherTest extends AbstractMatcherPolicyRuleTest {
}
@Test public void testFails() throws Exception {
- final OrMatcher matcher = newOrMatcher(Arrays.asList(Matcher.MATCHES_ALL, Matcher.MATCHER_FAILS));
+ final OrMatcher matcher = newOrMatcher(CollectionSupport.listOf(Matcher.MATCHES_ALL, Matcher.MATCHER_FAILS));
matcher.setId("test");
matcher.initialize();
diff --git a/shib-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java b/shib-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java
index 125a5db3d..28950e339 100644
--- a/shib-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java
+++ b/shib-attribute-impl/src/test/java/net/shibboleth/idp/attribute/transcoding/impl/AttributeTranscoderRegistryImplTest.java
@@ -31,8 +31,6 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import com.google.common.base.Predicates;
-
import net.shibboleth.idp.attribute.AttributeDecodingException;
import net.shibboleth.idp.attribute.AttributeEncodingException;
import net.shibboleth.idp.attribute.EmptyAttributeValue;
@@ -41,8 +39,10 @@ import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.transcoding.AttributeTranscoder;
import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry;
import net.shibboleth.idp.attribute.transcoding.AttributeTranscoderRegistry.NamingFunction;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.collection.Pair;
import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.logic.PredicateSupport;
import net.shibboleth.shared.testing.MockApplicationContext;
import net.shibboleth.idp.attribute.transcoding.BasicNamingFunction;
import net.shibboleth.idp.attribute.transcoding.TranscoderSupport;
@@ -94,7 +94,7 @@ public class AttributeTranscoderRegistryImplTest {
final Map<String,Object> ruleset3 = new HashMap<>();
ruleset3.put(AttributeTranscoderRegistry.PROP_ID, "foo");
ruleset3.put(AttributeTranscoderRegistry.PROP_TRANSCODER, transcoder);
- ruleset3.put(AttributeTranscoderRegistry.PROP_CONDITION, Predicates.alwaysFalse());
+ ruleset3.put(AttributeTranscoderRegistry.PROP_CONDITION, PredicateSupport.alwaysFalse());
ruleset3.put(AttributeTranscoderRegistry.PROP_DISPLAY_NAME + '.' + Locale.CANADA_FRENCH.toLanguageTag(), "Canadian French name2");
ruleset3.put(AttributeTranscoderRegistry.PROP_DESCRIPTION + '.' + Locale.FRENCH.toLanguageTag(), "French desc");
ruleset3.put("name", "ban");
@@ -116,7 +116,7 @@ public class AttributeTranscoderRegistryImplTest {
ruleset6.put(AttributeTranscoderRegistry.PROP_DECODER, "false");
ruleset6.put("name", "foo");
- registry.setTranscoderRegistry(List.of(
+ registry.setTranscoderRegistry(CollectionSupport.listOf(
new TranscodingRule(ruleset1),
new TranscodingRule(ruleset2),
new TranscodingRule(ruleset3),
diff --git a/shib-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPlugin.java b/shib-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPlugin.java
index 83bc2e468..c5d5ea790 100644
--- a/shib-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPlugin.java
+++ b/shib-attribute-resolver-api/src/main/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPlugin.java
@@ -30,8 +30,6 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.slf4j.Logger;
import org.springframework.beans.factory.DisposableBean;
-import com.google.common.base.Predicates;
-
import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
import net.shibboleth.idp.attribute.resolver.context.AttributeResolverWorkContext;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
@@ -42,6 +40,7 @@ import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent;
import net.shibboleth.shared.component.ComponentInitializationException;
import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.logic.PredicateSupport;
import net.shibboleth.shared.primitive.LoggerFactory;
/**
@@ -226,7 +225,7 @@ public abstract class AbstractResolverPlugin<ResolvedType> extends AbstractIdent
/** {@inheritDoc} */
@Override protected void doDestroy() {
- activationCondition = Predicates.alwaysFalse();
+ activationCondition = PredicateSupport.alwaysFalse();
attributeDependencies = CollectionSupport.emptySet();
dataConnectorDependencies = CollectionSupport.emptySet();
super.doDestroy();
diff --git a/shib-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPluginTest.java b/shib-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPluginTest.java
index 643a9a497..bd3b711d9 100644
--- a/shib-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPluginTest.java
+++ b/shib-attribute-resolver-api/src/test/java/net/shibboleth/idp/attribute/resolver/AbstractResolverPluginTest.java
@@ -27,8 +27,6 @@ import org.opensaml.profile.context.ProfileRequestContext;
import org.testng.Assert;
import org.testng.annotations.Test;
-import com.google.common.base.Predicates;
-
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.resolver.context.AttributeResolutionContext;
@@ -37,7 +35,6 @@ import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.PredicateSupport;
/** Unit test for {@link ResolverPlugin}. */
- at SuppressWarnings("javadoc")
public class AbstractResolverPluginTest {
/** Test an instantiated object has the proper state. */
@@ -58,7 +55,7 @@ public class AbstractResolverPluginTest {
final MockBaseAttributeResolver plugin = new MockBaseAttributeResolver(" foo ", "bar");
plugin.setActivationCondition(PredicateSupport.alwaysFalse());
- Assert.assertEquals(plugin.getActivationCondition(), Predicates.alwaysFalse());
+ Assert.assertEquals(plugin.getActivationCondition(), PredicateSupport.alwaysFalse());
}
/** Test setters to {@link AbstractResolverPlugin#setPropagateResolutionExceptions(boolean)}. */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list