@Test
public void testGetProxyForPrincipalValue() {

    // empty strings should return null
    assertNull(zts.getProxyForPrincipalValue("", "athenz.syncer", "athenz", "getToken"));
    // invalid proxy users should return exception
    try {
        zts.getProxyForPrincipalValue("invalid user", "athenz.syncer", "athenz", "getAccessToken");
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
    // valid authorized user should return the proxy user
    assertEquals("user_domain.proxy", zts.getProxyForPrincipalValue("user_domain.proxy",
            "user_domain.proxy-user1", "user_domain", "getAccessToken"));
    // invalid authorized proxy user should return 403
    try {
        zts.getProxyForPrincipalValue("user_domain.proxy", "user_domain.proxy-unknown",
                "user_domain", "getAccessToken");
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 403);
    }
}