[java-identity-provider COMMIT] in /trunk: idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/res...

noreply at shibboleth.net noreply at shibboleth.net
Sun Jun 29 09:35:10 EDT 2014


Author: rdw
Date: Sun Jun 29 09:35:10 2014
New Revision: 6181

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6181&view=rev
Log:
IDP-425 Make sure that the computed connectors look at data connectors as well as attributes.

This involves ensuring that the dependencies are initialised correctly and then just calling the correct helper method.

Also remove workaround from the test file which initially flushed this error.

Modified:
    trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/ComputedIDDataConnectorTest.java
    trunk/idp-attribute-resolver-spring/src/test/resources/net/shibboleth/idp/attribute/resolver/spring/pc/stored.xml
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/attribute/resolver/impl/AbstractPersistentIdDataConnector.java

Modified: trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/ComputedIDDataConnectorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/ComputedIDDataConnectorTest.java?rev=6181&r1=6180&r2=6181&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/ComputedIDDataConnectorTest.java (original)
+++ trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/ComputedIDDataConnectorTest.java Sun Jun 29 09:35:10 2014
@@ -101,12 +101,14 @@
         resolver.initialize();
         connector.initialize();
 
-        final AttributeResolutionContext context = TestSources.createResolutionContext(TestSources.PRINCIPAL_ID,
-                TestSources.IDP_ENTITY_ID, TestSources.SP_ENTITY_ID);
+        final AttributeResolutionContext context =
+                TestSources.createResolutionContext(TestSources.PRINCIPAL_ID, TestSources.IDP_ENTITY_ID,
+                        TestSources.SP_ENTITY_ID);
         resolver.resolveAttributes(context);
 
         // Now test that we got exactly what we expected - two scoped attributes
-        Set<IdPAttributeValue<?>> resultValues = context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME).getValues();
+        Set<IdPAttributeValue<?>> resultValues =
+                context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME).getValues();
         Assert.assertEquals(resultValues.size(), 1);
         Assert.assertEquals(((StringAttributeValue) resultValues.iterator().next()).getValue(), RESULT);
     }
@@ -198,12 +200,14 @@
         connectorFromResolver(resolver).initialize();
         ComponentSupport.initialize(resolver);
 
-        AttributeResolutionContext context = TestSources.createResolutionContext(TestSources.PRINCIPAL_ID,
-                TestSources.IDP_ENTITY_ID, TestSources.SP_ENTITY_ID);
+        AttributeResolutionContext context =
+                TestSources.createResolutionContext(TestSources.PRINCIPAL_ID, TestSources.IDP_ENTITY_ID,
+                        TestSources.SP_ENTITY_ID);
         resolver.resolveAttributes(context);
 
         // Now test that we got exactly what we expected
-        Set<IdPAttributeValue<?>> resultValues = context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME).getValues();
+        Set<IdPAttributeValue<?>> resultValues =
+                context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME).getValues();
         Assert.assertEquals(resultValues.size(), 1);
         Assert.assertEquals(((StringAttributeValue) resultValues.iterator().next()).getValue(), RESULT);
 
@@ -214,8 +218,9 @@
         connectorFromResolver(resolver).initialize();
         ComponentSupport.initialize(resolver);
 
-        context = TestSources.createResolutionContext(TestSources.PRINCIPAL_ID, TestSources.IDP_ENTITY_ID,
-                TestSources.SP_ENTITY_ID);
+        context =
+                TestSources.createResolutionContext(TestSources.PRINCIPAL_ID, TestSources.IDP_ENTITY_ID,
+                        TestSources.SP_ENTITY_ID);
         resolver.resolveAttributes(context);
 
         // Now test that we got exactly what we expected
@@ -256,7 +261,6 @@
         connectorFromResolver(resolver).initialize();
         ComponentSupport.initialize(resolver);
 
-
         context = TestSources.createResolutionContext(null, TestSources.IDP_ENTITY_ID, TestSources.SP_ENTITY_ID);
         resolver.resolveAttributes(context);
         Assert.assertNull(context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME));
@@ -276,6 +280,42 @@
         context = TestSources.createResolutionContext(null, TestSources.IDP_ENTITY_ID, TestSources.SP_ENTITY_ID);
         resolver.resolveAttributes(context);
         Assert.assertNull(context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME));
-
-    }
+    }
+
+    @Test public void case425() throws ComponentInitializationException, ResolutionException {
+

[... 159 lines stripped ...]


More information about the commits mailing list