Search in sources :

Example 6 with Attributes

use of org.glassfish.security.services.api.common.Attributes in project Payara by payara.

the class AttributesTest method testAttributesReplace.

@Test
public void testAttributesReplace() {
    String attName = "test";
    Attributes att = new AttributesImpl();
    att.addAttribute(attName, "value1", false);
    att.addAttribute(attName, "value2", true);
    Set<String> vs = att.getAttributeValues(attName);
    Assert.assertEquals(1, vs.size());
    Assert.assertFalse(vs.contains("value1"));
    Assert.assertTrue(vs.contains("value2"));
}
Also used : Attributes(org.glassfish.security.services.api.common.Attributes) Test(org.junit.Test)

Example 7 with Attributes

use of org.glassfish.security.services.api.common.Attributes in project Payara by payara.

the class AttributesTest method testAttributesNull.

@Test
public void testAttributesNull() {
    String attName = "test";
    Attributes att = new AttributesImpl();
    att.addAttribute(attName, (String) null, false);
    Set<String> vs = att.getAttributeValues(attName);
    Assert.assertEquals(0, vs.size());
}
Also used : Attributes(org.glassfish.security.services.api.common.Attributes) Test(org.junit.Test)

Aggregations

Attributes (org.glassfish.security.services.api.common.Attributes)7 Test (org.junit.Test)6 URI (java.net.URI)1 BitSet (java.util.BitSet)1 AzResult (org.glassfish.security.services.api.authorization.AzResult)1 Attribute (org.glassfish.security.services.api.common.Attribute)1 AuthorizationServiceImpl (org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl)1 AzResourceImpl.decodeURI (org.glassfish.security.services.impl.authorization.AzResourceImpl.decodeURI)1 AttributesImpl (org.glassfish.security.services.impl.common.AttributesImpl)1