/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.opentable.jaxrs;

import org.junit.Ignore;

// It sucks that this test is ignored, but I have no idea how to test e.g. socket
// connect timeouts without a lot of harnessing...
@Ignore
public class ResteasyClientBuilderTest
{
// TODO
}

@@ -588,16 +588,23 @@
 %0Aimport 
+static 
 org.juni
@@ -609,205 +609,1877 @@
 nit.
-Ignore;%0A%0A// It sucks that this test is ignored, but I have no idea how to test e.g. socket%0A// connect timeouts without a lot of harnessing...%0A@Ignore%0Apublic class ResteasyClientBuilderTest%0A%7B%0A// TODO
+Assert.assertEquals;%0A%0Aimport java.io.IOException;%0Aimport java.net.InetAddress;%0Aimport java.net.InetSocketAddress;%0A%0Aimport javax.ws.rs.client.Client;%0Aimport javax.ws.rs.core.HttpHeaders;%0Aimport javax.ws.rs.core.Response;%0A%0Aimport com.sun.net.httpserver.HttpExchange;%0Aimport com.sun.net.httpserver.HttpHandler;%0Aimport com.sun.net.httpserver.HttpServer;%0A%0Aimport org.junit.Test;%0A%0Aimport com.opentable.config.Config;%0A%0Apublic class ResteasyClientBuilderTest %7B%0A    private static final String BAD_URI = %22http://example.invalid%22;%0A    private final JaxRsClientConfig config = Config.getEmptyConfig().getBean(JaxRsClientConfig.class);%0A%0A    @Test%0A    public void testNoRedirect() throws Exception %7B%0A        final HttpServer server = HttpServer.create(new InetSocketAddress(InetAddress.getLocalHost(), 0), 1);%0A        try %7B%0A            server.createContext(%22/%22, new RedirectHandler());%0A            server.start();%0A%0A            final InetSocketAddress addr = server.getAddress();%0A            Client client = new JaxRsClientFactoryImpl().newBuilder(%22test%22, config).build();%0A            try %7B%0A                Response r = client.target(%22http://%22 + addr.getHostString() + %22:%22 + addr.getPort()).request()%0A                        .property(JaxRsClientProperties.FOLLOW_REDIRECTS, false)%0A                        .get();%0A                assertEquals(301, r.getStatus());%0A                assertEquals(BAD_URI, r.getHeaderString(HttpHeaders.LOCATION));%0A            %7D finally %7B%0A                client.close();%0A            %7D%0A        %7D finally %7B%0A            server.stop(0);%0A        %7D%0A    %7D%0A%0A    private static class RedirectHandler implements HttpHandler%0A    %7B%0A        @Override%0A        public void handle(HttpExchange h) throws IOException %7B%0A            h.getResponseHeaders().add(HttpHeaders.LOCATION, BAD_URI);%0A            h.sendResponseHeaders(301, -1);%0A            h.close();%0A        %7D%0A    %7D
 %0A%7D%0A

Add a failing test showing that redirects are on by default.