[java-identity-provider] 03/03: CheckStyle: Deprecated Predicate method and imports

Rod Widdowson rdw at steadingsoftware.com
Tue Feb 12 10:33:58 EST 2019


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

rdw 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=3b13af423a55fb92ce8abc94c38ed941b482f6c2

commit 3b13af423a55fb92ce8abc94c38ed941b482f6c2
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Tue Feb 12 15:33:36 2019 +0000

    CheckStyle: Deprecated Predicate method and imports
    
    Replace use of #apply() with #test() in a few test cases.
---
 .../idp/attribute/resolver/ad/impl/LogicTest.java  | 24 +++++++++++-----------
 .../spring/ad/SimpleAttributeParserTest.java       |  6 +++---
 .../impl/GlobalAttributeConsentPredicateTest.java  | 12 +++++------
 .../profile/logic/DateAttributePredicateTest.java  |  2 +-
 .../profile/logic/RelyingPartyIdPredicateTest.java | 12 +++++------
 .../idp/profile/logic/ScriptedPredicateTest.java   | 20 +++++++++---------
 6 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/LogicTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/LogicTest.java
index 9641709..9fbcb8f 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/LogicTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/LogicTest.java
@@ -42,14 +42,14 @@ public class LogicTest {
     @Test public void empty() {
         final ProfileRequestContext pfc = new ProfileRequestContext<>();
         
-        Assert.assertFalse(aiip.apply(pfc));
-        Assert.assertFalse(app.apply(pfc));
-        Assert.assertFalse(arip.apply(pfc));
+        Assert.assertFalse(aiip.test(pfc));
+        Assert.assertFalse(app.test(pfc));
+        Assert.assertFalse(arip.test(pfc));
 
         pfc.getSubcontext(AttributeResolutionContext.class, true);
-        Assert.assertFalse(aiip.apply(pfc));
-        Assert.assertFalse(app.apply(pfc));
-        Assert.assertFalse(arip.apply(pfc));
+        Assert.assertFalse(aiip.test(pfc));
+        Assert.assertFalse(app.test(pfc));
+        Assert.assertFalse(arip.test(pfc));
     }
     
     @Test public void wrong() {
@@ -60,9 +60,9 @@ public class LogicTest {
         arc.setPrincipal("badValue");
         arc.setAttributeRecipientID("badValue");
         
-        Assert.assertFalse(aiip.apply(pfc));
-        Assert.assertFalse(app.apply(pfc));
-        Assert.assertFalse(arip.apply(pfc));
+        Assert.assertFalse(aiip.test(pfc));
+        Assert.assertFalse(app.test(pfc));
+        Assert.assertFalse(arip.test(pfc));
     }
 
     @Test public void correct() {
@@ -73,8 +73,8 @@ public class LogicTest {
         arc.setPrincipal("Principal");
         arc.setAttributeRecipientID("ARI");
         
-        Assert.assertTrue(aiip.apply(pfc));
-        Assert.assertTrue(app.apply(pfc));
-        Assert.assertTrue(arip.apply(pfc));
+        Assert.assertTrue(aiip.test(pfc));
+        Assert.assertTrue(app.test(pfc));
+        Assert.assertTrue(arip.test(pfc));
     }
 }
diff --git a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/SimpleAttributeParserTest.java b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/SimpleAttributeParserTest.java
index 029cbfb..54b112b 100644
--- a/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/SimpleAttributeParserTest.java
+++ b/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/ad/SimpleAttributeParserTest.java
@@ -167,10 +167,10 @@ public class SimpleAttributeParserTest extends BaseAttributeDefinitionParserTest
         ProfileRequestContext prc = new ProfileRequestContext<>();
         RelyingPartyContext rpContext = prc.getSubcontext(RelyingPartyContext.class, true);
         rpContext.setRelyingPartyId("p1");
-        Assert.assertTrue(pre.apply(prc));
+        Assert.assertTrue(pre.test(prc));
         rpContext.setRelyingPartyId("p2 p3");
-        Assert.assertFalse(pre.apply(prc));
+        Assert.assertFalse(pre.test(prc));
         rpContext.setRelyingPartyId("p3");
-        Assert.assertTrue(pre.apply(prc));
+        Assert.assertTrue(pre.test(prc));
     }
 }
diff --git a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java
index 3c1df34..035949f 100644
--- a/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java
+++ b/idp-consent-impl/src/test/java/net/shibboleth/idp/consent/logic/impl/GlobalAttributeConsentPredicateTest.java
@@ -46,23 +46,23 @@ public class GlobalAttributeConsentPredicateTest {
     }
 
     @Test public void testNullInput() {
-        Assert.assertFalse(p.apply(null));
+        Assert.assertFalse(p.test(null));
     }
 
     @Test public void testNullConsentContext() {
-        Assert.assertFalse(p.apply(prc));
+        Assert.assertFalse(p.test(prc));
     }
 
     @Test public void testNoPreviousConsents() {
         prc.addSubcontext(new ConsentContext());
-        Assert.assertFalse(p.apply(prc));
+        Assert.assertFalse(p.test(prc));
     }
 
     @Test public void testNonGlobalPreviousConsents() {
         final ConsentContext consentContext = new ConsentContext();
         consentContext.getPreviousConsents().putAll(ConsentTestingSupport.newConsentMap());
         prc.addSubcontext(consentContext);
-        Assert.assertFalse(p.apply(prc));
+        Assert.assertFalse(p.test(prc));
     }
 
     @Test public void testApprovedGlobalConsent() {
@@ -72,7 +72,7 @@ public class GlobalAttributeConsentPredicateTest {
         final ConsentContext consentContext = new ConsentContext();
         consentContext.getPreviousConsents().put(globalConsent.getId(), globalConsent);
         prc.addSubcontext(consentContext);
-        Assert.assertTrue(p.apply(prc));
+        Assert.assertTrue(p.test(prc));
     }
 
     @Test public void testNotApprovedGlobalConsent() {
@@ -82,7 +82,7 @@ public class GlobalAttributeConsentPredicateTest {
         final ConsentContext consentContext = new ConsentContext();
         consentContext.getPreviousConsents().put(globalConsent.getId(), globalConsent);
         prc.addSubcontext(consentContext);
-        Assert.assertFalse(p.apply(prc));
+        Assert.assertFalse(p.test(prc));
     }
 
 }
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java
index 05d2921..8d56fbe 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/DateAttributePredicateTest.java
@@ -94,7 +94,7 @@ public class DateAttributePredicateTest {
             final String attribute,
             final String[] values,
             final boolean expected) throws Exception {
-        assertEquals(predicate.apply(createProfileRequestContext(attribute, values)), expected);
+        assertEquals(predicate.test(createProfileRequestContext(attribute, values)), expected);
     }
 
     private ProfileRequestContext createProfileRequestContext(final String name, final String[] values) {
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java
index 4b1a904..ac2dbe2 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/RelyingPartyIdPredicateTest.java
@@ -45,30 +45,30 @@ public class RelyingPartyIdPredicateTest {
     public void testNone() throws ComponentInitializationException {
         final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(Collections.<String>emptySet());
         
-        Assert.assertFalse(pred.apply(prc));
+        Assert.assertFalse(pred.test(prc));
         
         rpCtx.setRelyingPartyId("foo");
-        Assert.assertFalse(pred.apply(prc));
+        Assert.assertFalse(pred.test(prc));
     }
 
     @Test
     public void testMatch() throws ComponentInitializationException {
         final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(Collections.singleton("foo"));
         
-        Assert.assertFalse(pred.apply(prc));
+        Assert.assertFalse(pred.test(prc));
         
         rpCtx.setRelyingPartyId("foo");
-        Assert.assertTrue(pred.apply(prc));
+        Assert.assertTrue(pred.test(prc));
     }
 
     @Test
     public void testNoMatch() throws ComponentInitializationException {
         final RelyingPartyIdPredicate pred = new RelyingPartyIdPredicate(Collections.singleton("bar"));
         
-        Assert.assertFalse(pred.apply(prc));
+        Assert.assertFalse(pred.test(prc));
         
         rpCtx.setRelyingPartyId("foo");
-        Assert.assertFalse(pred.apply(prc));
+        Assert.assertFalse(pred.test(prc));
     }
 
 }
\ No newline at end of file
diff --git a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java
index d23ec87..6c87dd0 100644
--- a/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java
+++ b/idp-profile-api/src/test/java/net/shibboleth/idp/profile/logic/ScriptedPredicateTest.java
@@ -46,25 +46,25 @@ public class ScriptedPredicateTest {
 
     @Test public void simple() throws ScriptException {
         ScriptedPredicate test = ScriptedPredicate.inlineScript("new java.lang.Boolean(true);");
-        Assert.assertTrue(test.apply(withChild));
+        Assert.assertTrue(test.test(withChild));
 
         test = ScriptedPredicate.inlineScript("true");
-        Assert.assertTrue(test.apply(withChild));
+        Assert.assertTrue(test.test(withChild));
 
         test = ScriptedPredicate.inlineScript("false");
-        Assert.assertFalse(test.apply(withChild));
+        Assert.assertFalse(test.test(withChild));
 
         test = ScriptedPredicate.inlineScript("\"thirty\"");
-        Assert.assertFalse(test.apply(withChild));
+        Assert.assertFalse(test.test(withChild));
     }
     
     @Test public void custom() throws ScriptException {
         ScriptedPredicate test = ScriptedPredicate.inlineScript("custom;");
         test.setCustomObject(Boolean.valueOf(true));
-        Assert.assertTrue(test.apply(withChild));
+        Assert.assertTrue(test.test(withChild));
 
         test.setCustomObject(Boolean.valueOf(false));
-        Assert.assertFalse(test.apply(withChild));
+        Assert.assertFalse(test.test(withChild));
 
     }
     @Test public void inlineBean() throws ScriptException {
@@ -80,9 +80,9 @@ public class ScriptedPredicateTest {
             ctx.refresh();
             final ScriptedPredicate rule = ctx.getBean(ScriptedPredicate.class);
 
-            Assert.assertTrue(rule.apply(withChild));
+            Assert.assertTrue(rule.test(withChild));
 
-            Assert.assertFalse(rule.apply(noChild));
+            Assert.assertFalse(rule.test(noChild));
         } finally {
             ctx.close();
         }
@@ -101,9 +101,9 @@ public class ScriptedPredicateTest {
             ctx.refresh();
             final ScriptedPredicate rule = ctx.getBean(ScriptedPredicate.class);
 
-            Assert.assertTrue(rule.apply(withChild));
+            Assert.assertTrue(rule.test(withChild));
 
-            Assert.assertFalse(rule.apply(noChild));
+            Assert.assertFalse(rule.test(noChild));
         } finally {
             ctx.close();
         }

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


More information about the commits mailing list