[java-metadata-aggregator] 03/03: MDA-55 add ability to filter entity attribute values
Ian Young
ian at iay.org.uk
Fri Dec 4 10:52:33 EST 2015
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch master
in repository java-metadata-aggregator.
commit f2590fbe50f362aeee405b819f2c0093a252c65f
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Fri Dec 4 15:51:06 2015 +0000
MDA-55 add ability to filter entity attribute values
Rename entity attribute context implementation class to ContextImpl,
move tests into the tests for the enclosing class.
---
.../saml/mdattr/EntityAttributeFilteringStage.java | 8 ++--
.../mdattr/EntityAttributeFilteringStageTest.java | 34 +++++++++++++++++
.../mdattr/EntityCategoryMatcherSpringTest.java | 24 ++++++------
.../dom/saml/mdattr/EntityCategoryMatcherTest.java | 24 ++++++------
.../mdattr/EntityCategorySupportMatcherTest.java | 24 ++++++------
.../dom/saml/mdattr/MultiPredicateMatcherTest.java | 4 +-
.../mdattr/RegistrationAuthorityMatcherTest.java | 14 +++----
.../mdattr/SimpleEntityAttributeContextTest.java | 43 ----------------------
8 files changed, 83 insertions(+), 92 deletions(-)
diff --git a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStage.java b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStage.java
index 825fd59..9851627 100644
--- a/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStage.java
+++ b/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStage.java
@@ -106,7 +106,7 @@ public class EntityAttributeFilteringStage extends BaseStage<Element> {
/**
* A simple immutable implementation of {@link EntityAttributeContext}.
*/
- static class SimpleEntityAttributeContext implements EntityAttributeContext {
+ static class ContextImpl implements EntityAttributeContext {
/** The attribute's value. */
@Nonnull
@@ -132,7 +132,7 @@ public class EntityAttributeFilteringStage extends BaseStage<Element> {
* @param attributeNameFormat attribute <code>NameFormat</code>
* @param registrar entity's registration authority, or <code>null</code>
*/
- public SimpleEntityAttributeContext(@Nonnull final String attributeValue,
+ public ContextImpl(@Nonnull final String attributeValue,
@Nonnull final String attributeName,
@Nonnull final String attributeNameFormat,
@Nullable final String registrar) {
@@ -149,7 +149,7 @@ public class EntityAttributeFilteringStage extends BaseStage<Element> {
* @param attributeName attribute <code>Name</code>
* @param attributeNameFormat attribute <code>NameFormat</code>
*/
- public SimpleEntityAttributeContext(@Nonnull final String attributeValue,
+ public ContextImpl(@Nonnull final String attributeValue,
@Nonnull final String attributeName,
@Nonnull final String attributeNameFormat) {
this(attributeValue, attributeName, attributeNameFormat, null);
@@ -302,7 +302,7 @@ public class EntityAttributeFilteringStage extends BaseStage<Element> {
// Construct an entity attribute context to be matched against
final EntityAttributeContext ctx =
- new SimpleEntityAttributeContext(attributeValue, attributeName,
+ new ContextImpl(attributeValue, attributeName,
attributeNameFormat, registrationAuthority);
final boolean matched = applyRules(ctx);
if (matched ^ whitelisting) {
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStageTest.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStageTest.java
index 3989fa9..063b686 100644
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStageTest.java
+++ b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityAttributeFilteringStageTest.java
@@ -7,9 +7,11 @@ import java.util.List;
import net.shibboleth.metadata.Item;
import net.shibboleth.metadata.dom.BaseDOMTest;
import net.shibboleth.metadata.dom.DOMElementItem;
+import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.ContextImpl;
import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.EntityAttributeContext;
import net.shibboleth.metadata.dom.saml.mdrpi.RegistrationAuthorityPopulationStage;
+import org.testng.Assert;
import org.testng.annotations.Test;
import org.w3c.dom.Element;
@@ -173,4 +175,36 @@ public class EntityAttributeFilteringStageTest extends BaseDOMTest {
assertXMLIdentical(expected, result);
}
+ // Tests for ContextImpl inner class
+
+ @Test
+ public void contextImplFour() {
+ final EntityAttributeContext ctx = new ContextImpl("a", "b", "c", "d");
+ Assert.assertEquals(ctx.getValue(), "a");
+ Assert.assertEquals(ctx.getName(), "b");
+ Assert.assertEquals(ctx.getNameFormat(), "c");
+ Assert.assertEquals(ctx.getRegistrationAuthority(), "d");
+ }
+
+ @Test
+ public void contextImplThree() {
+ final EntityAttributeContext ctx = new ContextImpl("a", "b", "c");
+ Assert.assertEquals(ctx.getValue(), "a");
+ Assert.assertEquals(ctx.getName(), "b");
+ Assert.assertEquals(ctx.getNameFormat(), "c");
+ Assert.assertNull(ctx.getRegistrationAuthority());
+ }
+
+ @Test
+ public void contextImplstringFour() {
+ final EntityAttributeContext ctx = new ContextImpl("a", "b", "c", "d");
+ Assert.assertEquals(ctx.toString(), "{v=a, n=b, f=c, r=d}");
+ }
+
+ @Test
+ public void contextImplstringThree() {
+ final EntityAttributeContext ctx = new ContextImpl("a", "b", "c");
+ Assert.assertEquals(ctx.toString(), "{v=a, n=b, f=c, r=(none)}");
+ }
+
}
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherSpringTest.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherSpringTest.java
index b03afc2..a14f787 100644
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherSpringTest.java
+++ b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherSpringTest.java
@@ -9,7 +9,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.EntityAttributeContext;
-import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.SimpleEntityAttributeContext;
+import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.ContextImpl;
/**
* This is the same as {@link EntityCategoryMatcherTest}, but pulls the matcher beans
@@ -31,19 +31,19 @@ public class EntityCategoryMatcherSpringTest extends AbstractTestNGSpringContext
(Predicate<EntityAttributeContext>)applicationContext.getBean("categoryMatcherNoRA");
// all four components match
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "whatever"));
// context has no RA
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
// these matches should fail because one component differs
- test(false, matcher, new SimpleEntityAttributeContext("category2", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category2", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", null));
}
@@ -53,21 +53,21 @@ public class EntityCategoryMatcherSpringTest extends AbstractTestNGSpringContext
(Predicate<EntityAttributeContext>)applicationContext.getBean("categoryMatcherWithRA");
// all four components match
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
// context has no RA
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
// these matches should fail because one component differs
- test(false, matcher, new SimpleEntityAttributeContext("category2", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category2", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar2"));
}
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherTest.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherTest.java
index 76b67d4..9ed35f9 100644
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherTest.java
+++ b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategoryMatcherTest.java
@@ -7,7 +7,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.EntityAttributeContext;
-import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.SimpleEntityAttributeContext;
+import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.ContextImpl;
public class EntityCategoryMatcherTest {
@@ -21,19 +21,19 @@ public class EntityCategoryMatcherTest {
final Predicate<EntityAttributeContext> matcher = new EntityCategoryMatcher("category");
// all four components match
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "whatever"));
// context has no RA
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
// these matches should fail because one component differs
- test(false, matcher, new SimpleEntityAttributeContext("category2", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category2", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", null));
}
@@ -42,21 +42,21 @@ public class EntityCategoryMatcherTest {
final Predicate<EntityAttributeContext> matcher = new EntityCategoryMatcher("category", "registrar");
// all four components match
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
// context has no RA
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
// these matches should fail because one component differs
- test(false, matcher, new SimpleEntityAttributeContext("category2", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category2", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar2"));
}
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategorySupportMatcherTest.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategorySupportMatcherTest.java
index dcfbc56..87b0a6a 100644
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategorySupportMatcherTest.java
+++ b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/EntityCategorySupportMatcherTest.java
@@ -7,7 +7,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.EntityAttributeContext;
-import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.SimpleEntityAttributeContext;
+import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.ContextImpl;
public class EntityCategorySupportMatcherTest {
@@ -21,19 +21,19 @@ public class EntityCategorySupportMatcherTest {
final Predicate<EntityAttributeContext> matcher = new EntityCategorySupportMatcher("category");
// all four components match
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "whatever"));
// context has no RA
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
// these matches should fail because one component differs
- test(false, matcher, new SimpleEntityAttributeContext("category2", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category2", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", null));
}
@@ -42,21 +42,21 @@ public class EntityCategorySupportMatcherTest {
final Predicate<EntityAttributeContext> matcher = new EntityCategorySupportMatcher("category", "registrar");
// all four components match
- test(true, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(true, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
// context has no RA
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", null));
// these matches should fail because one component differs
- test(false, matcher, new SimpleEntityAttributeContext("category2", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category2", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("category", "http://macedir.org/entity-category-support",
+ test(false, matcher, new ContextImpl("category", "http://macedir.org/entity-category-support",
"urn:oasis:names:tc:SAML:2.0:attrname-format:uri", "registrar2"));
}
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/MultiPredicateMatcherTest.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/MultiPredicateMatcherTest.java
index 3672a18..97d3352 100644
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/MultiPredicateMatcherTest.java
+++ b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/MultiPredicateMatcherTest.java
@@ -8,12 +8,12 @@ import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.EntityAttributeContext;
-import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.SimpleEntityAttributeContext;
+import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.ContextImpl;
public class MultiPredicateMatcherTest {
private final EntityAttributeContext context =
- new SimpleEntityAttributeContext("valuevalue", "namename", "fmtfmt", "regreg");
+ new ContextImpl("valuevalue", "namename", "fmtfmt", "regreg");
@Test
public void testNothing() {
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/RegistrationAuthorityMatcherTest.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/RegistrationAuthorityMatcherTest.java
index a6902fc..91cc5f6 100644
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/RegistrationAuthorityMatcherTest.java
+++ b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/RegistrationAuthorityMatcherTest.java
@@ -7,7 +7,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.EntityAttributeContext;
-import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.SimpleEntityAttributeContext;
+import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.ContextImpl;
public class RegistrationAuthorityMatcherTest {
@@ -20,18 +20,18 @@ public class RegistrationAuthorityMatcherTest {
public void testWithRA() {
final Predicate<EntityAttributeContext> matcher = new RegistrationAuthorityMatcher("registrar");
- test(true, matcher, new SimpleEntityAttributeContext("a", "b", "c", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("a", "b", "c", "registrar2"));
- test(false, matcher, new SimpleEntityAttributeContext("a", "b", "c", null));
+ test(true, matcher, new ContextImpl("a", "b", "c", "registrar"));
+ test(false, matcher, new ContextImpl("a", "b", "c", "registrar2"));
+ test(false, matcher, new ContextImpl("a", "b", "c", null));
}
@Test
public void testNoRA() {
final Predicate<EntityAttributeContext> matcher = new RegistrationAuthorityMatcher(null);
- test(false, matcher, new SimpleEntityAttributeContext("a", "b", "c", "registrar"));
- test(false, matcher, new SimpleEntityAttributeContext("a", "b", "c", "registrar2"));
- test(true, matcher, new SimpleEntityAttributeContext("a", "b", "c", null));
+ test(false, matcher, new ContextImpl("a", "b", "c", "registrar"));
+ test(false, matcher, new ContextImpl("a", "b", "c", "registrar2"));
+ test(true, matcher, new ContextImpl("a", "b", "c", null));
}
}
diff --git a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/SimpleEntityAttributeContextTest.java b/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/SimpleEntityAttributeContextTest.java
deleted file mode 100644
index d53ea1a..0000000
--- a/aggregator-pipeline/src/test/java/net/shibboleth/metadata/dom/saml/mdattr/SimpleEntityAttributeContextTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-
-package net.shibboleth.metadata.dom.saml.mdattr;
-
-
-import org.testng.Assert;
-import org.testng.annotations.Test;
-
-import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.EntityAttributeContext;
-import net.shibboleth.metadata.dom.saml.mdattr.EntityAttributeFilteringStage.SimpleEntityAttributeContext;
-
-public class SimpleEntityAttributeContextTest {
-
- @Test
- public void testFour() {
- final EntityAttributeContext ctx = new SimpleEntityAttributeContext("a", "b", "c", "d");
- Assert.assertEquals(ctx.getValue(), "a");
- Assert.assertEquals(ctx.getName(), "b");
- Assert.assertEquals(ctx.getNameFormat(), "c");
- Assert.assertEquals(ctx.getRegistrationAuthority(), "d");
- }
-
- @Test
- public void testThree() {
- final EntityAttributeContext ctx = new SimpleEntityAttributeContext("a", "b", "c");
- Assert.assertEquals(ctx.getValue(), "a");
- Assert.assertEquals(ctx.getName(), "b");
- Assert.assertEquals(ctx.getNameFormat(), "c");
- Assert.assertNull(ctx.getRegistrationAuthority());
- }
-
- @Test
- public void stringFour() {
- final EntityAttributeContext ctx = new SimpleEntityAttributeContext("a", "b", "c", "d");
- Assert.assertEquals(ctx.toString(), "{v=a, n=b, f=c, r=d}");
- }
-
- @Test
- public void stringThree() {
- final EntityAttributeContext ctx = new SimpleEntityAttributeContext("a", "b", "c");
- Assert.assertEquals(ctx.toString(), "{v=a, n=b, f=c, r=(none)}");
- }
-
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list