[java-identity-provider COMMIT] in /trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl: AttributeS...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Mar 9 22:18:12 EST 2016
Author: scantor
Date: Wed Mar 9 22:18:11 2016
New Revision: 8141
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8141&view=rev
Log:
IDP-504 - Unit tests should avoid creating XMLObjectBuilders explicitly
https://issues.shibboleth.net/jira/browse/IDP-504
Modified:
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIDDecoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/CryptoTransientNameIdentifierDecoderTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIDCanonicalizationTest.java
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/NameIdentifierCanonicalizationTest.java
Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java?rev=8141&r1=8140&r2=8141&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML1NameIdentifierGeneratorTest.java Wed Mar 9 22:18:11 2016
@@ -32,12 +32,12 @@
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.opensaml.core.OpenSAMLInitBaseTestCase;
+import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.saml.common.SAMLException;
+import org.opensaml.saml.common.SAMLObjectBuilder;
import org.opensaml.saml.saml1.core.NameIdentifier;
-import org.opensaml.saml.saml1.core.impl.NameIdentifierBuilder;
import org.opensaml.saml.saml2.core.NameID;
-import org.opensaml.saml.saml2.core.impl.NameIDBuilder;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -48,9 +48,9 @@
/** The name we give the test attribute. */
private final static String ATTR_NAME = "foo";
- private static NameIdentifierBuilder saml1Builder;
-
- private static NameIDBuilder saml2Builder;
+ private static SAMLObjectBuilder<NameIdentifier> saml1Builder;
+
+ private static SAMLObjectBuilder<NameID> saml2Builder;
/** test values. */
private final static String NAME_1 = "NameId1";
@@ -86,8 +86,14 @@
generator = new AttributeSourcedSAML1NameIdentifierGenerator();
generator.setId("test");
generator.setFormat(NameIdentifier.X509_SUBJECT);
- saml1Builder = new NameIdentifierBuilder();
- saml2Builder = new NameIDBuilder();
+ saml1Builder = (SAMLObjectBuilder<NameIdentifier>)
+ XMLObjectProviderRegistrySupport.getBuilderFactory().<NameIdentifier>getBuilderOrThrow(
+ NameIdentifier.DEFAULT_ELEMENT_NAME);
+
+ saml2Builder = (SAMLObjectBuilder<NameID>)
+ XMLObjectProviderRegistrySupport.getBuilderFactory().<NameID>getBuilderOrThrow(
+ NameID.DEFAULT_ELEMENT_NAME);
+
prc = new RequestContextBuilder().buildProfileRequestContext();
}
Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java?rev=8141&r1=8140&r2=8141&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/nameid/impl/AttributeSourcedSAML2NameIDGeneratorTest.java Wed Mar 9 22:18:11 2016
@@ -32,12 +32,12 @@
import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import org.opensaml.core.OpenSAMLInitBaseTestCase;
+import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
import org.opensaml.profile.context.ProfileRequestContext;
import org.opensaml.saml.common.SAMLException;
+import org.opensaml.saml.common.SAMLObjectBuilder;
import org.opensaml.saml.saml1.core.NameIdentifier;
-import org.opensaml.saml.saml1.core.impl.NameIdentifierBuilder;
import org.opensaml.saml.saml2.core.NameID;
-import org.opensaml.saml.saml2.core.impl.NameIDBuilder;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -48,9 +48,9 @@
[... 167 lines stripped ...]
More information about the commits
mailing list