[java-identity-provider] 01/02: IDP-1386 Add a canary test.

Rod Widdowson rdw at steadingsoftware.com
Thu Jan 3 09:23:06 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=ad39ab1edee24e9c82529f02cc92dd4c5f5e45df

commit ad39ab1edee24e9c82529f02cc92dd4c5f5e45df
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu Jan 3 14:20:00 2019 +0000

    IDP-1386  Add a canary test.
    
    https://issues.shibboleth.net/jira/browse/IDP-1386
---
 .../attribute/resolver/ad/impl/TemplateAttributeTest.java    | 12 +++++++++++-
 .../test/java/net/shibboleth/idp/saml/impl/TestSources.java  |  2 --
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java
index e5fea2d..ae8bf20 100644
--- a/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java
+++ b/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/ad/impl/TemplateAttributeTest.java
@@ -18,6 +18,7 @@
 package net.shibboleth.idp.attribute.resolver.ad.impl;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -48,6 +49,7 @@ import org.testng.annotations.Test;
 
 /** test for {@link net.shibboleth.idp.attribute.resolver.impl.TemplateAttribute}. */
 @ThreadSafe
+ at SuppressWarnings("deprecation")
 public class TemplateAttributeTest {
 
     /** The name. */
@@ -236,6 +238,8 @@ public class TemplateAttributeTest {
      * Test resolution of an template script with data generated from the attributes, but with
      * explicit setting of source attributes.
      *
+     * This is a canary for IDP-1386
+     *
      * @throws ResolutionException if it goes wrong.
      * @throws ComponentInitializationException if it goes wrong.
      */
@@ -259,18 +263,24 @@ public class TemplateAttributeTest {
         templateDef.setTemplateText(TEST_ATTRIBUTES_TEMPLATE_CONNECTOR);
 
         final Set<ResolverPluginDependency> ds = new LazySet<>();
+        
         ds.add(TestSources.makeResolverPluginDependency(TestSources.DEPENDS_ON_ATTRIBUTE_NAME_ATTR));
+        if (setSources) {
+            ds.add(new ResolverPluginDependency(TestSources.DEPENDS_ON_ATTRIBUTE_NAME_ATTR+"2"));
+        }
         ds.add(TestSources.makeResolverPluginDependency(TestSources.STATIC_CONNECTOR_NAME,
                 TestSources.DEPENDS_ON_SECOND_ATTRIBUTE_NAME));
         templateDef.setDependencies(ds);
         if (setSources) {
-            templateDef.setSourceAttributes(Collections.singletonList(TestSources.DEPENDS_ON_ATTRIBUTE_NAME_ATTR));
+            templateDef.setSourceAttributes(Arrays.asList(TestSources.DEPENDS_ON_ATTRIBUTE_NAME_ATTR,
+                    TestSources.DEPENDS_ON_SECOND_ATTRIBUTE_NAME));
         }
         templateDef.initialize();
 
         final Set<AttributeDefinition> attrDefinitions = new LazySet<>();
         attrDefinitions.add(templateDef);
         attrDefinitions.add(TestSources.populatedStaticAttribute());
+        attrDefinitions.add(TestSources.populatedStaticAttribute(TestSources.DEPENDS_ON_ATTRIBUTE_NAME_ATTR+"2", 3));
         final Set<DataConnector> dataDefinitions = new LazySet<>();
         dataDefinitions.add(TestSources.populatedStaticConnector());
 
diff --git a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/TestSources.java b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/TestSources.java
index fbd711c..eb6e214 100644
--- a/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/TestSources.java
+++ b/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/TestSources.java
@@ -228,8 +228,6 @@ public final class TestSources {
         return retVal;
     }
 
-
-
     @SuppressWarnings("unused")
     private static class StaticAttributeDefinition extends AbstractAttributeDefinition {
 

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


More information about the commits mailing list