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);
}
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();
}
Aggregations