SimplePrincipal implements Principal { public static Principal create(String domain, String name, String creds) { return create(domain, name, creds, 0, null); } private  SimplePrincipal(String domain, String name, String creds, long issueTime, Authority authority); private  SimplePrincipal(String domain, String creds, List<String> roles, Authority authority); static Principal create(String domain, String name, String creds); static Principal create(String domain, String creds, List<String> roles, Authority authority); static Principal create(String domain, String name, String creds, Authority authority); static Principal create(String domain, String name, String creds, long issueTime,
            Authority authority); static Principal create(String appId, String creds, Authority authority); void setUnsignedCreds(String unsignedCreds); void setAuthorizedService(String authorizedService); void setIP(String ip); void setOriginalRequestor(String originalRequestor); void setKeyService(String keyService); void setKeyId(String keyId); void setX509Certificate(X509Certificate x509Certificate); void setApplicationId(String applicationId); void setRoles(List<String> roles); void setMtlsRestricted(boolean isMtlsRestricted); @Override String getIP(); @Override String getUnsignedCredentials(); @Override Authority getAuthority(); @Override String getDomain(); @Override String getName(); @Override String getOriginalRequestor(); @Override String getFullName(); @Override String getCredentials(); @Override List<String> getRoles(); @Override long getIssueTime(); String toString(); @Override String getAuthorizedService(); @Override String getKeyService(); @Override String getKeyId(); @Override X509Certificate getX509Certificate(); @Override String getApplicationId(); @Override boolean getMtlsRestricted();  }
@Test public void testSimplePrincipalNullRole() { UserAuthority userAuthority = new UserAuthority(); userAuthority.initialize(); assertNull(SimplePrincipal.create("user", fakeCreds, (List<String>) null, userAuthority)); }
@Test public void testSimplePrincipalNullDomainAuthorityDomainNotNull() { Principal p = SimplePrincipal.create("user", "jdoe", fakeCreds, 0, null); assertNotNull(p); }
@Test public void testSimplePrincipalDomainNoMatch() { UserAuthority userAuthority = new UserAuthority(); userAuthority.initialize(); Principal p = SimplePrincipal.create("coretech", "jdoe", fakeCreds, 0, userAuthority); assertNull(p); }