TrustedUserPrincipal extends Principal { public String getUsername() { return username; } TrustedUserPrincipal(String username); String getUsername(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String getType(); @Override String getName(); @Override boolean hasFullAccess(); @Override boolean canAccess(Object target, SubResource subResource, Access access);  }
@Test public void name() { assertEquals("admin", principal.getPrincipalName()); assertEquals(principal.getUsername(), principal.getPrincipalName()); }
@Test public void username() { assertEquals("admin", principal.getUsername()); assertEquals(principal.getPrincipalName(), principal.getUsername()); }