[java-idp-integration-tests] branch main updated: Remove override SAML1TestResponseValidator for IdP V4 tests

Tom Zeller tzeller at dragonacea.biz
Mon May 6 17:12:26 UTC 2024


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

tzeller pushed a commit to branch main
in repository java-idp-integration-tests.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=f1d0388334a3b9fada31931e05be8c39bdc3d8ff

The following commit(s) were added to refs/heads/main by this push:
     new f1d0388  Remove override SAML1TestResponseValidator for IdP V4 tests
f1d0388 is described below

commit f1d0388334a3b9fada31931e05be8c39bdc3d8ff
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Mon May 6 12:12:16 2024 -0500

    Remove override SAML1TestResponseValidator for IdP V4 tests
    
    No longer support testing 4.3.1 or earlier, current is 4.3.2.
    
    https://shibboleth.atlassian.net/browse/IDP-2173
---
 .../tests/saml1/AbstractSAML1IntegrationTest.java  |  2 +-
 .../tests/saml1/SAML1TestResponseValidator.java    | 96 ----------------------
 2 files changed, 1 insertion(+), 97 deletions(-)

diff --git a/src/test/java/net/shibboleth/idp/integration/tests/saml1/AbstractSAML1IntegrationTest.java b/src/test/java/net/shibboleth/idp/integration/tests/saml1/AbstractSAML1IntegrationTest.java
index 5e75886..23d545e 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/saml1/AbstractSAML1IntegrationTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/saml1/AbstractSAML1IntegrationTest.java
@@ -28,6 +28,7 @@ import javax.annotation.Nullable;
 
 import net.shibboleth.idp.integration.tests.BaseIntegrationTest;
 import net.shibboleth.idp.integration.tests.BrowserData;
+import net.shibboleth.idp.test.flows.saml1.SAML1TestResponseValidator;
 import net.shibboleth.shared.xml.XMLParserException;
 
 import org.opensaml.core.xml.io.Unmarshaller;
@@ -57,7 +58,6 @@ public class AbstractSAML1IntegrationTest extends BaseIntegrationTest {
     public void setUpValidator() throws IOException {
         validator = new SAML1TestResponseValidator();
         validator.authenticationMethod = AuthenticationStatement.PASSWORD_AUTHN_METHOD;
-        validator.idpVersion = idpVersion;
     }
 
     /**
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/saml1/SAML1TestResponseValidator.java b/src/test/java/net/shibboleth/idp/integration/tests/saml1/SAML1TestResponseValidator.java
deleted file mode 100644
index 33eecd2..0000000
--- a/src/test/java/net/shibboleth/idp/integration/tests/saml1/SAML1TestResponseValidator.java
+++ /dev/null
@@ -1,96 +0,0 @@
-
-package net.shibboleth.idp.integration.tests.saml1;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
-import org.opensaml.saml.saml1.core.Attribute;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.testng.Assert;
-
-/**
- * Override SAML1TestResponseValidator from idp-conf-impl for IdP V4.
- */
-public class SAML1TestResponseValidator extends net.shibboleth.idp.test.flows.saml1.SAML1TestResponseValidator {
-
-    /** IdP version determined from distribution name. **/
-    @Nullable public String idpVersion;
-
-    /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(SAML1TestResponseValidator.class);
-
-    /**
-     * Expect 4 attributes instead of 5 for IdP V4.
-     * 
-     * {@inheritDoc}
-     */
-    @Override
-    public void assertAttributes(List<Attribute> attributes) {
-        if (idpVersion != null && idpVersion.startsWith("4")) {
-            if (idpVersion.startsWith("4.3.2")) {
-                super.assertAttributes(attributes);
-            } else {
-                log.info("Expect 4 attributes instead of 5 for IdP V4 (4.3.1 or earlier)");
-                assertAttributesV4(attributes);
-            }
-        } else {
-            super.assertAttributes(attributes);
-        }
-    }
-
-    /**
-     * Expect 4 attributes instead of 5 for IdP V4.
-     * 
-     * Copied from
-     * {@link net.shibboleth.idp.test.flows.saml1.SAML1TestResponseValidator#assertAttributes(List)}
-     */
-    public void assertAttributesV4(@Nullable final List<Attribute> attributes) {
-        assert attributes != null;
-        Assert.assertFalse(attributes.isEmpty());
-        Assert.assertEquals(attributes.size(), usedAttributeDesignators ? 2 : 4); // IdP V5 expects 5 attributes
-
-        // Ignore attribute ordering
-        final Map<String, Attribute> actualAttributes = new HashMap<>();
-        for (final Attribute attribute : attributes) {
-            actualAttributes.put(attribute.getAttributeName(), attribute);
-        }
-
-        if (usedAttributeDesignators) {
-            final Attribute actualMailAttribute = actualAttributes.get("urn:mace:dir:attribute-def:mail");
-            Assert.assertNotNull(actualMailAttribute);
-            assertAttribute(actualMailAttribute, "urn:mace:dir:attribute-def:mail", "jdoe at example.org");
-
-            // The scope here is in a separate XML attribute, so not in the element content.
-            final Attribute actualEPSAAttribute = actualAttributes
-                    .get("urn:mace:dir:attribute-def:eduPersonScopedAffiliation");
-            Assert.assertNotNull(actualEPSAAttribute);
-            assertAttribute(actualEPSAAttribute, "urn:mace:dir:attribute-def:eduPersonScopedAffiliation", "member");
-        } else {
-            final Attribute actualUidAttribute = actualAttributes.get("urn:mace:dir:attribute-def:uid");
-            Assert.assertNotNull(actualUidAttribute);
-            assertAttribute(actualUidAttribute, "urn:mace:dir:attribute-def:uid", "jdoe");
-
-            final Attribute actualMailAttribute = actualAttributes.get("urn:mace:dir:attribute-def:mail");
-            Assert.assertNotNull(actualMailAttribute);
-            assertAttribute(actualMailAttribute, "urn:mace:dir:attribute-def:mail", "jdoe at example.org");
-
-            // The scope here is in a separate XML attribute, so not in the element content.
-            final Attribute actualEPPNAttribute = actualAttributes
-                    .get("urn:mace:dir:attribute-def:eduPersonPrincipalName");
-            Assert.assertNotNull(actualEPPNAttribute);
-            assertAttribute(actualEPPNAttribute, "urn:mace:dir:attribute-def:eduPersonPrincipalName", "jdoe");
-
-            // The scope here is in a separate XML attribute, so not in the element content.
-            final Attribute actualEPSAAttribute = actualAttributes
-                    .get("urn:mace:dir:attribute-def:eduPersonScopedAffiliation");
-            Assert.assertNotNull(actualEPSAAttribute);
-            assertAttribute(actualEPSAAttribute, "urn:mace:dir:attribute-def:eduPersonScopedAffiliation", "member");
-        }
-    }
-
-}

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


More information about the commits mailing list