@Test
public void invalidPath() {

    String  data[] = new String[] { "json:never/find/me", "never",
                                    "json:metadata/name/yet/deeper", "deeper" };
    for (int i = 0; i < data.length; i +=2) {
        DelegatingAuthenticator authenticator = new DelegatingAuthenticator("jolokia", url, data[i], false);
        HttpExchange exchange = createHttpExchange(new Headers(), "Authorization", "Bearer blub");
        Authenticator.Result result = authenticator.authenticate(exchange);
        Authenticator.Failure failure = (Authenticator.Failure) result;
        assertEquals(failure.getResponseCode(), 400);
        String error = exchange.getResponseHeaders().getFirst("X-Error-Details");
        assertTrue(error.contains(data[i+1]));
    }
}