ClientConfig config = new ClientConfig();
ProxyAuthSecurityHandler proxyAuthSecurityHandler = new ProxyAuthSecurityHandler();
proxyAuthSecurityHandler.setUserName("username");
proxyAuthSecurityHandler.setPassword("password");
config.handlers(proxyAuthSecurityHandler);
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) {