@Test
public void testGetPublicKeyEntryInvalidKeyId() {

    
    SignedDomain signedDomain = createSignedDomain("coretech", "weather", "storage", true);
    store.processDomain(signedDomain, false);
    
    SimplePrincipal principal = (SimplePrincipal) SimplePrincipal.create("hockey", "kings",
            "v=S1,d=hockey;n=kings;s=sig", 0, new PrincipalAuthority());
    ResourceContext context = createResourceContext(principal);
    
    // with null we get 400
    try {
        zts.getPublicKeyEntry(context, "coretech", "storage", null);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
    
    // with nonexistent we get 404
    try {
        zts.getPublicKeyEntry(context, "coretech", "storage", "999999");
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 404);
    }
}