@Test
public void testAccessInvalidResourceDomain() {

    ZTSAuthorizer authz = new ZTSAuthorizer(null);
    Authority authority = Mockito.mock(Authority.class);
    Mockito.when(authority.allowAuthorization()).thenReturn(true);
    Principal principal = Mockito.mock(Principal.class);
    Mockito.when(principal.getAuthority()).thenReturn(authority);
    try {
        authz.access("op", "invalid-resource", principal, null);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 404);
    }
}