package org.concordion.cubano.driver.http;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

import java.io.IOException;

import org.junit.Test;

public class HttpEasyReaderTests {

    @Test
    public void httpEasyRequest() throws HttpResponseException, IOException {
        
        // ProxyConfig proxyConfig = Config.getInstance().getProxyConfig();

        // if (proxyConfig.isProxyRequired()) {
        // HttpEasy.withDefaults()
        // .proxy(new Proxy(Proxy.Type.HTTP,
        // new InetSocketAddress(proxyConfig.getProxyHost(), proxyConfig.getProxyPort())))
        // .proxyAuth(proxyConfig.getProxyUsername(), proxyConfig.getProxyPassword())
        // .bypassProxyForLocalAddresses(true);
        // }

        JsonReader response = HttpEasy.request()
                .baseURI("http://httpbin.org")
                .header("hellow", "world")
                .path("get")
                .queryParam("name", "fred")
                .withLogWriter(new TestLogWriter())
                .logRequestDetails()
                .get()
                .getJsonReader();

        response = HttpEasy.request()
                .baseURI("http://httpbin.org")
                .header("hell", "world")
                .path("get")
                .queryParam("myname", "fred")
                .withLogWriter(new TestLogWriter())
                .logRequestDetails()
                .get()
                .getJsonReader();

        assertThat(response.getAsString("url"), is("http://httpbin.org/get?name=fred"));

    }

}

@@ -1118,356 +1118,8 @@
 );%0A%0A
-        response = HttpEasy.request()%0A                .baseURI(%22http://httpbin.org%22)%0A                .header(%22hell%22, %22world%22)%0A                .path(%22get%22)%0A                .queryParam(%22myname%22, %22fred%22)%0A                .withLogWriter(new TestLogWriter())%0A                .logRequestDetails()%0A                .get()%0A                .getJsonReader();%0A%0A
     

Fix test