ClientConfig config = new ClientConfig();
BasicAuthSecurityHandler basicAuthSecurityHandler = new BasicAuthSecurityHandler();
// oops, forgot to set username!
basicAuthSecurityHandler.setPassword("password");
config.handlers(basicAuthSecurityHandler);
RestClient client = new RestClient(config);
Resource resource = client.resource(serviceURL);
try {
@SuppressWarnings("unused")
ClientResponse response = resource.get();
fail("should have got a ClientAuthenticationException");
} catch (ClientAuthenticationException e) {