use of org.apache.cxf.sts.claims.ProcessedClaimCollection in project cxf by apache.
the class JexlClaimsMapperTest method testUpperCaseClaim.
@Test
public void testUpperCaseClaim() throws IOException {
ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
assertNotNull(result);
ProcessedClaim claim = findClaim(result, "http://my.schema.org/identity/claims/uppercase");
assertNotNull(claim);
assertNotNull(claim.getValues());
assertEquals(2, claim.getValues().size());
assertEquals("VALUE2", claim.getValues().get(1));
}
use of org.apache.cxf.sts.claims.ProcessedClaimCollection in project cxf by apache.
the class JexlClaimsMapperTest method testSimpleClaimCopy.
@Test
public void testSimpleClaimCopy() throws IOException {
ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
assertNotNull(result);
ProcessedClaim claim = findClaim(result, "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mail");
assertNotNull(claim);
assertNotNull(claim.getValues());
assertEquals(1, claim.getValues().size());
assertEquals("test@apache.com", claim.getValues().get(0));
}
use of org.apache.cxf.sts.claims.ProcessedClaimCollection in project cxf by apache.
the class JexlClaimsMapperTest method testValueFilter.
@Test
public void testValueFilter() throws IOException {
ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
assertNotNull(result);
ProcessedClaim claim = findClaim(result, "http://my.schema.org/identity/claims/filter");
assertEquals(2, claim.getValues().size());
assertTrue(claim.getValues().contains("match"));
assertTrue(claim.getValues().contains("second_match"));
}
use of org.apache.cxf.sts.claims.ProcessedClaimCollection in project cxf by apache.
the class JexlClaimsMapperTest method testSingleToMultiValue.
@Test
public void testSingleToMultiValue() throws IOException {
ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
assertNotNull(result);
ProcessedClaim claim = findClaim(result, "http://my.schema.org/identity/claims/single2multi");
assertNotNull(claim);
assertNotNull(claim.getValues());
assertEquals(3, claim.getValues().size());
assertEquals("Value2", claim.getValues().get(1));
}
use of org.apache.cxf.sts.claims.ProcessedClaimCollection in project cxf by apache.
the class JexlClaimsMapperTest method testRoleMappings.
@Test
public void testRoleMappings() throws IOException {
ProcessedClaimCollection result = jcm.mapClaims("A", createClaimCollection(), "B", createProperties());
assertNotNull(result);
assertTrue(result.size() >= 1);
assertEquals(2, result.get(0).getValues().size());
assertTrue(result.get(0).getValues().contains("manager"));
assertTrue(result.get(0).getValues().contains("administrator"));
}
Aggregations