@Test
public void invalidProtocol() {

    DelegatingAuthenticator authenticator = new DelegatingAuthenticator("jolokia","ftp://ftp.redhat.com",null,false);
    Authenticator.Result result = authenticator.authenticate(createHttpExchange(new Headers()));
    Authenticator.Failure failure = (Authenticator.Failure) result;
    assertEquals(failure.getResponseCode(),401);
}