// Path: src/main/java/com/difference/historybook/proxy/ProxyFilter.java
// public interface ProxyFilter {
// 	/**
// 	 * Perform arbitrary processing based on a given @ProxyRequest
// 	 * @param request 
// 	 */
// 	public void processRequest(ProxyRequest request);
// 
// 	/**
// 	 * Perform arbitrary processing based on a given @ProxyResponse
// 	 * @param response 
// 	 */
// 	public void processResponse(ProxyResponse response);
// }


import org.apache.commons.io.IOUtils;
import org.junit.Rule;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.google.common.base.Charsets;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.junit.Test;
import com.difference.historybook.proxy.ProxyFilter;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
			assertEquals("chunked", connection.getHeaderField("Transfer-Encoding"));
			
			byte[] fetchedContent = IOUtils.toByteArray(connection.getInputStream());
			assertArrayEquals(body, fetchedContent);
			
			proxy.stop();
		} catch (Exception e) {
			fail(e.getLocalizedMessage());
		}
		
	}
	
	@Test
	public void testSelector() {
		String body = "<html><head></head><body>Hello World!</body></html>";
		
		stubFor(get(urlEqualTo("/some/page"))
	            .willReturn(aResponse()
	                .withStatus(200)
	                .withHeader("Content-Type", "text/html")
	                .withBody(body)));
		
		stubFor(get(urlEqualTo("/some/other/page"))
	            .willReturn(aResponse()
	                .withStatus(201)
	                .withHeader("Content-Type", "text/html")
	                .withBody(body)));

		Proxy proxy = getProxy().setPort(PROXY_PORT);
		
// Path: src/main/java/com/difference/historybook/proxy/ProxyFilter.java
// public interface ProxyFilter {
// 	/**
// 	 * Perform arbitrary processing based on a given @ProxyRequest
// 	 * @param request 
// 	 */
// 	public void processRequest(ProxyRequest request);
// 
// 	/**
// 	 * Perform arbitrary processing based on a given @ProxyResponse
// 	 * @param response 
// 	 */
// 	public void processResponse(ProxyResponse response);
// }


// Path: src/test/java/com/difference/historybook/proxy/ProxyTest.java
import org.apache.commons.io.IOUtils;
import org.junit.Rule;
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.google.common.base.Charsets;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import org.junit.Test;
import com.difference.historybook.proxy.ProxyFilter;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

			assertEquals("chunked", connection.getHeaderField("Transfer-Encoding"));
			
			byte[] fetchedContent = IOUtils.toByteArray(connection.getInputStream());
			assertArrayEquals(body, fetchedContent);
			
			proxy.stop();
		} catch (Exception e) {
			fail(e.getLocalizedMessage());
		}
		
	}
	
	@Test
	public void testSelector() {
		String body = "<html><head></head><body>Hello World!</body></html>";
		
		stubFor(get(urlEqualTo("/some/page"))
	            .willReturn(aResponse()
	                .withStatus(200)
	                .withHeader("Content-Type", "text/html")
	                .withBody(body)));
		
		stubFor(get(urlEqualTo("/some/other/page"))
	            .willReturn(aResponse()
	                .withStatus(201)
	                .withHeader("Content-Type", "text/html")
	                .withBody(body)));

		Proxy proxy = getProxy().setPort(PROXY_PORT);
		
		ProxyFilter filter = mock(ProxyFilter.class);