[java-identity-provider COMMIT] in /trunk/idp-consent/src: main/java/net/shibboleth/idp/consent/context/AttributeRele...

noreply at shibboleth.net noreply at shibboleth.net
Tue Nov 18 15:54:40 EST 2014


Author: tzeller
Date: Tue Nov 18 15:54:39 2014
New Revision: 6940

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=6940&view=rev
Log:
Checkpoint consent cleanup and tests.

Added:
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/ConsentTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/ConsentTestingSupport.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/context/
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/context/AttributeReleaseContextTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/context/ConsentContextTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/AbstractConsentActionTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/ConsentFlowDescriptorTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/ExtractConsentTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/InitializeConsentContextTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/PopulateConsentContextTest.java   (with props)
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/ar/
    trunk/idp-consent/src/test/java/net/shibboleth/idp/consent/flow/storage/
Modified:
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/context/AttributeReleaseContext.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/context/ConsentContext.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/AbstractConsentAction.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ConsentFlowDescriptor.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ExtractConsent.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/InitializeConsentContext.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/PopulateConsentContext.java
    trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/flow/ar/PopulateAttributeReleaseContext.java

Modified: trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/context/AttributeReleaseContext.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/context/AttributeReleaseContext.java?rev=6940&r1=6939&r2=6940&view=diff
==============================================================================
--- trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/context/AttributeReleaseContext.java (original)
+++ trunk/idp-consent/src/main/java/net/shibboleth/idp/consent/context/AttributeReleaseContext.java Tue Nov 18 15:54:39 2014
@@ -17,30 +17,32 @@
 
 package net.shibboleth.idp.consent.context;
 
-import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 import javax.annotation.Nonnull;
 
 import net.shibboleth.idp.attribute.IdPAttribute;
+import net.shibboleth.utilities.java.support.annotation.constraint.Live;
 import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
-import net.shibboleth.utilities.java.support.logic.Constraint;
 
 import org.opensaml.messaging.context.BaseContext;
 
-import com.google.common.collect.MapConstraints;
+import com.google.common.base.MoreObjects;
 
 /**
- * Context for attribute consent. Holds the attributes for which consent is obtained.
+ * Context for attribute release consent.
+ * 
+ * Holds the attributes for which consent is obtained.
  */
 public class AttributeReleaseContext extends BaseContext {
 
     /** Attributes to be consented to. */
-    @Nonnull @NonnullElements private Map<String, IdPAttribute> consentableAttributes;
+    @Nonnull @NonnullElements @Live private Map<String, IdPAttribute> consentableAttributes;
 
     /** Constructor. */
     public AttributeReleaseContext() {
-        consentableAttributes = Collections.emptyMap();
+        consentableAttributes = new LinkedHashMap<>();
     }
 
     /**
@@ -48,18 +50,14 @@
      * 
      * @return the attributes to be consented to
      */
-    @Nonnull @NonnullElements public Map<String, IdPAttribute> getConsentableAttributes() {
+    @Nonnull @NonnullElements @Live public Map<String, IdPAttribute> getConsentableAttributes() {
         return consentableAttributes;
     }
 
-    /**
-     * Set the attributes to be consented to.
-     * 
-     * @param attributes the attributes to be consented to
-     */
-    public void setConsentableAttributes(@Nonnull @NonnullElements final Map<String, IdPAttribute> attributes) {
-        Constraint.isNotNull(attributes, "Consentable attributes cannot be null");
-
-        consentableAttributes = MapConstraints.constrainedMap(attributes, MapConstraints.notNull());
+    /** {@inheritDoc} */
+    @Override public String toString() {
+        return MoreObjects.toStringHelper(this)

[... 340 lines stripped ...]


More information about the commits mailing list