use of org.sonatype.goodies.httpfixture.server.jetty.behaviour.Debug in project goodies by sonatype.
the class JettyProxyProviderTest method testProxyGet.
@Test
public void testProxyGet() throws Exception {
JettyProxyProvider proxy = new JettyProxyProvider();
proxy.addBehaviour("/*", new Debug(), new Content());
proxy.start();
URL url = new URL("http://speutel.invalid/foo");
SocketAddress sa = new InetSocketAddress("localhost", proxy.getPort());
Proxy p = new Proxy(Type.HTTP, sa);
HttpURLConnection conn = (HttpURLConnection) url.openConnection(p);
conn.setDoInput(true);
conn.connect();
assertEquals(200, conn.getResponseCode());
assertEquals("foo", read(conn.getContent()).trim());
conn.disconnect();
}
Aggregations