public void testJaasFilterAuthenticationFailureWithRedirection() throws Exception {
String endpointAddress =
"http://localhost:" + PORT + "/service/jaas2/bookstorestorage/thosebooks/123";
WebClient wc = WebClient.create(endpointAddress);
wc.accept("text/xml,text/html");
wc.header(HttpHeaders.AUTHORIZATION,
"Basic " + base64Encode("foo" + ":" + "bar1"));
Response r = wc.get();
assertEquals(307, r.getStatus());
Object locationHeader = r.getMetadata().getFirst(HttpHeaders.LOCATION);
assertNotNull(locationHeader);