assertNotNull("Port is null", gordy);
// Okay, I'm sick of configuration files.
// This also tests dynamic configuration of the conduit.
Client client = ClientProxy.getClient(gordy);
HTTPConduit http =
(HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
httpClientPolicy.setAutoRedirect(true);
http.setClient(httpClientPolicy);
http.setTlsClientParameters(tlsClientParameters);
// We get redirected from Gordy, to Bethal.
http.setTrustDecider(
new MyHttpsTrustDecider(
new String[] {"Gordy", "Bethal"}));
// Without preemptive user/pass Bethal returns a
// 401 for realm Cronus. If we supply any name other
// than Edward, George, or Mary, with the pass of "password"
// we should succeed.
http.setBasicAuthSupplier(
new MyBasicAuthSupplier("Cronus", "Betty", "password"));
// We actually get our answer from Bethal at the end of the
// redirects.
String answer = gordy.sayHi();
assertTrue("Unexpected answer: " + answer,
"Bonjour from Bethal".equals(answer));
// Uhe loop auth supplier,
// We should die with looping realms.
http.setBasicAuthSupplier(new MyBasicAuthSupplier());
try {
answer = gordy.sayHi();
fail("Unexpected answer from Gordy: " + answer);
} catch (Exception e) {