Search in sources :

Example 1 with JwtClaimSubject

use of com.sun.identity.entitlement.JwtClaimSubject in project OpenAM by OpenRock.

the class EntitlementRegistryTest method shouldReturnCorrectSubjectName.

@Test
public void shouldReturnCorrectSubjectName() {
    // Given
    String name = "test";
    EntitlementSubject testSubject = new JwtClaimSubject();
    testRegistry.registerSubjectType(EntitlementSubject.class);
    testRegistry.registerSubjectType(name, JwtClaimSubject.class);
    // When
    String result = testRegistry.getSubjectName(testSubject);
    // Then
    assertThat(result).isEqualTo(name);
}
Also used : EntitlementSubject(com.sun.identity.entitlement.EntitlementSubject) JwtClaimSubject(com.sun.identity.entitlement.JwtClaimSubject) Test(org.testng.annotations.Test)

Example 2 with JwtClaimSubject

use of com.sun.identity.entitlement.JwtClaimSubject in project OpenAM by OpenRock.

the class EntitlementRegistryTest method shouldNotReturnSuperTypeSubjectNames.

@Test
public void shouldNotReturnSuperTypeSubjectNames() {
    // Given
    EntitlementSubject testSubject = new JwtClaimSubject();
    // Only super-type registered
    testRegistry.registerSubjectType(EntitlementSubject.class);
    // When
    String result = testRegistry.getSubjectName(testSubject);
    // Then
    assertThat(result).isNull();
}
Also used : EntitlementSubject(com.sun.identity.entitlement.EntitlementSubject) JwtClaimSubject(com.sun.identity.entitlement.JwtClaimSubject) Test(org.testng.annotations.Test)

Aggregations

EntitlementSubject (com.sun.identity.entitlement.EntitlementSubject)2 JwtClaimSubject (com.sun.identity.entitlement.JwtClaimSubject)2 Test (org.testng.annotations.Test)2