[java-identity-provider] 03/06: IDP-1376 Add test for duplcate names in AFP

Rod Widdowson rdw at steadingsoftware.com
Sun Jan 31 14:04:39 UTC 2021


This is an automated email from the git hooks/post-receive script.

rdw pushed a commit to branch main
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=93ba4cd54a524214b0c3eeb70531c67913fb553d

commit 93ba4cd54a524214b0c3eeb70531c67913fb553d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Jan 30 11:27:08 2021 +0000

    IDP-1376 Add test for duplcate names in AFP
    
    https://issues.shibboleth.net/jira/browse/IDP-1376
---
 .../idp/attribute/filter/spring/basic/AndTest.java |  9 +++++++++
 .../idp/attribute/filter/matcher/andMulti.xml      | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/AndTest.java b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/AndTest.java
index 1ceb98e00..65ac0b865 100644
--- a/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/AndTest.java
+++ b/idp-attribute-filter-spring/src/test/java/net/shibboleth/idp/attribute/filter/spring/basic/AndTest.java
@@ -18,6 +18,7 @@
 package net.shibboleth.idp.attribute.filter.spring.basic;
 
 import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
 
 import java.util.List;
 
@@ -48,6 +49,14 @@ public class AndTest extends BaseAttributeFilterParserTest {
         assertEquals(children.get(1).getClass(), Matcher.MATCHES_ALL.getClass());
     }
 
+    @Test public void multiNameTest() throws ComponentInitializationException {
+        AndMatcher what = (AndMatcher) getMatcher("andMulti.xml");
+        assertTrue(what.getId().endsWith("multi"));
+        final List<Matcher> children = what.getComposedMatchers();
+
+        assertEquals(children.size(), 5);
+    }
+
     @Test public void policy() throws ComponentInitializationException {
         AndPolicyRule what = (AndPolicyRule) getPolicyRule("and.xml");
         
diff --git a/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/matcher/andMulti.xml b/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/matcher/andMulti.xml
new file mode 100644
index 000000000..44576d19d
--- /dev/null
+++ b/idp-attribute-filter-spring/src/test/resources/net/shibboleth/idp/attribute/filter/matcher/andMulti.xml
@@ -0,0 +1,22 @@
+<AttributeRule attributeID="email"
+        xmlns="urn:mace:shibboleth:2.0:afp" xmlns:basic="urn:mace:shibboleth:2.0:afp:mf:basic"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="urn:mace:shibboleth:2.0:afp http://shibboleth.net/schema/idp/shibboleth-afp.xsd">
+	<PermitValueRule xsi:type="AND" id="multi">
+		<Rule xsi:type="NOT" id="Not1">
+			<Rule xsi:type="ANY" />
+		</Rule>
+		<Rule xsi:type="ANY" id="Not2"/>
+        <Rule xsi:type="OR" id="Not1">
+            <Rule xsi:type="ANY" />
+            <Rule xsi:type="ANY" />
+        </Rule>
+        <Rule xsi:type="NOT" id="Not3">
+            <Rule xsi:type="ANY" />
+        </Rule>
+        <Rule xsi:type="OR" id="Not1">
+            <Rule xsi:type="ANY" />
+            <Rule xsi:type="ANY" />
+        </Rule>
+    </PermitValueRule>
+</AttributeRule>
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list