@Test
public void testGetResourceAccessExt() {

    ZTSRDLClientMock ztsClientMock = new ZTSRDLClientMock();
    Principal principal = SimplePrincipal.create("user_domain", "user",
            "v=S1;d=user_domain;n=user;s=sig", PRINCIPAL_AUTHORITY);
    ZTSClient client = new ZTSClient("http://localhost:4080", principal);
    client.setZTSRDLGeneratedClient(ztsClientMock);
    ResourceAccess access = client.getResourceAccessExt("access", "resource", null, "principal");
    assertTrue(access.getGranted());
    access = client.getResourceAccessExt("access", "resource", null, "principal1");
    assertFalse(access.getGranted());
    try {
        client.getResourceAccessExt("exc", "resource", null, "principal");
        fail();
    } catch (ZTSClientException ex) {
        assertEquals(ex.getCode(), 400);
    }
    client.close();
}