[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
Thu Mar 20 23:42:22 EDT 2014


Author: dfisher
Date: Thu Mar 20 23:42:22 2014
New Revision: 5622

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5622&view=rev
Log:
IDP-357.
Remove the equality test in #altDataConnector, re-enable the test.

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

Modified: trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java?rev=5622&r1=5621&r2=5622&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java (original)
+++ trunk/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/impl/dc/ComputedIDDataConnectorTest.java Thu Mar 20 23:42:22 2014
@@ -193,8 +193,7 @@
         return (AbstractPersistentIdDataConnector) resolver.getDataConnectors().get(TEST_CONNECTOR_NAME);
     }
 
-    //TODO: fix assertion on line 218, see IDP-357 (note this line number isn't right anymore, don't know which test is involved)
-    @Test(enabled = false) public void altDataConnector() throws ComponentInitializationException, ResolutionException {
+    @Test public void altDataConnector() throws ComponentInitializationException, ResolutionException {
         AttributeResolver resolver = constructResolver(1);
         connectorFromResolver(resolver).initialize();
         ComponentSupport.initialize(resolver);
@@ -219,25 +218,25 @@
                 TestSources.SP_ENTITY_ID);
         resolver.resolveAttributes(context);
 
+        // Now test that we got exactly what we expected
+        // No equality test since we don't know which attribute will be returned
+        resultValues = context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME).getValues();
+        Assert.assertEquals(resultValues.size(), 1);
+
+        //
+        // And again with different values
+        //
+        resolver = constructResolver(1);
+
+        connectorFromResolver(resolver).initialize();
+        ComponentSupport.initialize(resolver);
+
+        context = TestSources.createResolutionContext(TestSources.PRINCIPAL_ID, TestSources.IDP_ENTITY_ID, "foo");
+        resolver.resolveAttributes(context);
+
         // Now test that we got exactly what we expected - two scoped attributes
         resultValues = context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME).getValues();
         Assert.assertEquals(resultValues.size(), 1);
-        Assert.assertEquals(((StringAttributeValue) resultValues.iterator().next()).getValue(), RESULT);
-
-        //
-        // And again with different values
-        //
-        resolver = constructResolver(1);
-
-        connectorFromResolver(resolver).initialize();
-        ComponentSupport.initialize(resolver);
-
-        context = TestSources.createResolutionContext(TestSources.PRINCIPAL_ID, TestSources.IDP_ENTITY_ID, "foo");
-        resolver.resolveAttributes(context);
-
-        // Now test that we got exactly what we expected - two scoped attributes
-        resultValues = context.getResolvedIdPAttributes().get(OUTPUT_ATTRIBUTE_NAME).getValues();
-        Assert.assertEquals(resultValues.size(), 1);
         Assert.assertNotEquals(((StringAttributeValue) resultValues.iterator().next()).getValue(), RESULT);
 
     }

Modified: trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/attribute/resolver/AbstractPersistentIdDataConnector.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/attribute/resolver/AbstractPersistentIdDataConnector.java?rev=5622&r1=5621&r2=5622&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/attribute/resolver/AbstractPersistentIdDataConnector.java (original)
+++ trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/impl/attribute/resolver/AbstractPersistentIdDataConnector.java Thu Mar 20 23:42:22 2014
@@ -136,7 +136,7 @@
         }
 
         if (attributeValues.size() > 1) {
-            log.warn("{} Source attribute {} for connector {} has more than one value, only the first value is used",
+            log.warn("{} Source attribute {} for connector {} has more than one value, only one value is used",
                     getLogPrefix(), getSourceAttributeId(), getId());
         }
 



More information about the commits mailing list