@Test
public void testPostAccessTokenRequestInvalidDomain() {

    SignedDomain signedDomain = createSignedDomain("coretech", "weather", "storage", true);
    store.processDomain(signedDomain, false);
    Principal principal = SimplePrincipal.create("user_domain", "user",
            "v=U1;d=user_domain;n=user;s=signature", 0, null);
    ResourceContext context = createResourceContext(principal);
    try {
        zts.postAccessTokenRequest(context, "grant_type=client_credentials&scope=sportstest:domain");
        fail();
    } catch (ResourceException ex) {
        assertEquals(404, ex.getCode());
    }
}