@Test
public void testClose()
throws Exception
{
DataSize maxResponseSize = new DataSize(1, Unit.BYTE);
MockExchangeRequestProcessor processor = new MockExchangeRequestProcessor(maxResponseSize);
URI location = URI.create("http://localhost:8080");
processor.addPage(location, createPage(1));
processor.addPage(location, createPage(2));
processor.addPage(location, createPage(3));
@SuppressWarnings("resource")
ExchangeClient exchangeClient = new ExchangeClient(createTestingBlockEncodingManager(),
new DataSize(1, Unit.BYTE),
maxResponseSize, 1,
new Duration(1, TimeUnit.MINUTES),
new TestingHttpClient(processor, newCachedThreadPool(daemonThreadsNamed("test-%s"))),
executor);
exchangeClient.addLocation(location);