[java-identity-provider COMMIT] /trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/storage/ConsentSerializer...
noreply at shibboleth.net
noreply at shibboleth.net
Tue Nov 25 11:45:01 EST 2014
Author: tzeller
Date: Tue Nov 25 11:45:01 2014
New Revision: 7010
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7010&view=rev
Log:
Fix test to work with Java 8.
Modified:
trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/storage/ConsentSerializerTest.java
Modified: trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/storage/ConsentSerializerTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/storage/ConsentSerializerTest.java?rev=7010&r1=7009&r2=7010&view=diff
==============================================================================
--- trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/storage/ConsentSerializerTest.java (original)
+++ trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/storage/ConsentSerializerTest.java Tue Nov 25 11:45:01 2014
@@ -26,8 +26,8 @@
import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
-import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.consent.Consent;
+import net.shibboleth.idp.consent.ConsentTestingSupport;
import net.shibboleth.idp.consent.logic.AttributeValuesHashFunction;
import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
@@ -39,7 +39,6 @@
import org.testng.annotations.Test;
import com.google.common.base.Function;
-import com.google.common.collect.Sets;
/** Unit tests for {@link ConsentSerializer}. */
public class ConsentSerializerTest {
@@ -78,23 +77,16 @@
attributeValuesHashFunction = new AttributeValuesHashFunction();
- value1 = new StringAttributeValue("value1");
- value2 = new StringAttributeValue("value2");
-
- attribute1 = new IdPAttribute("attribute1");
- attribute1.setValues(Sets.newHashSet(value1));
-
- attribute2 = new IdPAttribute("attribute2");
- attribute2.setValues(Sets.newHashSet(value1, value2));
+ final Map<String, IdPAttribute> attributes = ConsentTestingSupport.newAttributeMap();
consent1 = new Consent();
consent1.setId("attribute1");
- consent1.setValue(attributeValuesHashFunction.apply(attribute1.getValues()));
+ consent1.setValue(attributeValuesHashFunction.apply(attributes.get("attribute1").getValues()));
consent1.setApproved(true);
consent2 = new Consent();
consent2.setId("attribute2");
- consent2.setValue(attributeValuesHashFunction.apply(attribute2.getValues()));
+ consent2.setValue(attributeValuesHashFunction.apply(attributes.get("attribute2").getValues()));
consent2.setApproved(false);
consents = new LinkedHashMap<>();
More information about the commits
mailing list