[java-identity-provider COMMIT] /trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1Na...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Jan 31 18:49:11 EST 2014
Author: tzeller
Date: Fri Jan 31 18:49:10 2014
New Revision: 5290
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5290&view=rev
Log:
Formatting.
Modified:
trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java
Modified: trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java?rev=5290&r1=5289&r2=5290&view=diff
==============================================================================
--- trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java (original)
+++ trunk/idp-saml-impl/src/test/java/net/shibboleth/idp/saml/impl/nameid/DefaultSAML1NameIdentifierGeneratorTest.java Fri Jan 31 18:49:10 2014
@@ -20,8 +20,8 @@
import java.util.Collection;
import java.util.Collections;
+import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.IdPAttributeValue;
-import net.shibboleth.idp.attribute.IdPAttribute;
import net.shibboleth.idp.attribute.ScopedStringAttributeValue;
import net.shibboleth.idp.attribute.StringAttributeValue;
import net.shibboleth.idp.attribute.XMLObjectAttributeValue;
@@ -79,7 +79,7 @@
}
private DefaultSAML1NameIdentifierGenerator generator;
-
+
private ProfileRequestContext prc;
@BeforeMethod public void initTest() throws ComponentInitializationException {
@@ -90,12 +90,12 @@
saml2Builder = new NameIDBuilder();
prc = new RequestContextBuilder().buildProfileRequestContext();
}
-
+
@Test(expectedExceptions = {ComponentInitializationException.class,}) public void testInvalidConfig()
throws Exception {
generator.initialize();
}
-
+
@Test public void testNoSource() throws ComponentInitializationException, ProfileException {
generator.setAttributeSourceIds(Collections.singletonList("bar"));
generator.initialize();
@@ -104,27 +104,24 @@
@Test public void testWrongType() throws Exception {
final int[] intArray = {1, 2, 3, 4};
- final Collection<? extends IdPAttributeValue<?>> values =
- Lists.newArrayList(
- new IdPAttributeValue<Object>() {
- public Object getValue() {
- return intArray;
- }
- }, saml2NameIdFor(OTHERID));
-
- final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
- inputAttribute.setValues(values);
- prc.getSubcontext(AttributeContext.class, true).setIdPAttributes(Collections.singleton(inputAttribute));
-
- generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
- generator.initialize();
-
+ final Collection<? extends IdPAttributeValue<?>> values = Lists.newArrayList(new IdPAttributeValue<Object>() {
+ public Object getValue() {
+ return intArray;
+ }
+ }, saml2NameIdFor(OTHERID));
+
+ final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
+ inputAttribute.setValues(values);
+ prc.getSubcontext(AttributeContext.class, true).setIdPAttributes(Collections.singleton(inputAttribute));
+
+ generator.setAttributeSourceIds(Collections.singletonList(ATTR_NAME));
+ generator.initialize();
+
Assert.assertNull(generator.generate(prc, generator.getFormat()));
}
@Test public void testWrongFormat() throws Exception {
- final Collection<? extends IdPAttributeValue<?>> values =
- Collections.singletonList(saml1NameIdFor(NAME_1));
+ final Collection<? extends IdPAttributeValue<?>> values = Collections.singletonList(saml1NameIdFor(NAME_1));
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(values);
prc.getSubcontext(AttributeContext.class, true).setIdPAttributes(Collections.singleton(inputAttribute));
@@ -134,10 +131,9 @@
generator.initialize();
Assert.assertNull(generator.generate(prc, generator.getFormat()));
}
-
+
@Test public void testNameIdentifierValued() throws Exception {
- final Collection<? extends IdPAttributeValue<?>> values =
- Collections.singletonList(saml1NameIdFor(NAME_1));
+ final Collection<? extends IdPAttributeValue<?>> values = Collections.singletonList(saml1NameIdFor(NAME_1));
final IdPAttribute inputAttribute = new IdPAttribute(ATTR_NAME);
inputAttribute.setValues(values);
prc.getSubcontext(AttributeContext.class, true).setIdPAttributes(Collections.singleton(inputAttribute));
@@ -169,7 +165,7 @@
Assert.assertEquals(outputNameId.getFormat(), NameIdentifier.X509_SUBJECT);
Assert.assertEquals(outputNameId.getNameQualifier(), QUALIFIER);
[... 28 lines stripped ...]
More information about the commits
mailing list