@Test
 public void testGetPrincipal() {
   Principal principal = identityService.getPrincipal("KULUSER");
   assertNotNull("principal must not be null", principal);
   assertEquals(
       "Principal name did not match expected result", "kuluser", principal.getPrincipalName());
 }
  @Test
  public void testGetContainedAttributes() {
    Principal principal = identityService.getPrincipal("p1");

    EntityDefault entity = identityService.getEntityDefault(principal.getEntityId());
    assertNotNull("Entity Must not be null", entity);
    EntityTypeContactInfoDefault eet = entity.getEntityType("PERSON");
    assertNotNull("PERSON EntityTypeData must not be null", eet);
    assertNotNull(
        "EntityEntityType's default email address must not be null", eet.getDefaultEmailAddress());
    assertEquals("*****@*****.**", eet.getDefaultEmailAddress().getEmailAddressUnmasked());
  }
 public String getCurrentUser() {
   return ((Principal) identityService.getPrincipal(getUserIdentifier())).getPrincipalName();
 }
 @Test
 public void testGetPrincipalNotFound() {
   Principal principal = identityService.getPrincipal("DoesNotExist");
   assertNull("principal should not be found", principal);
 }