@Test
    public void shouldExecuteResponseChainTwice() {
        policies.add(pwcOne);
        policies.add(pwcTwo);

        responseChain = new ResponseChain(policies, mockContext);

        responseChain.bodyHandler(mockBodyHandler);
        responseChain.endHandler(mockEndHandler);

        responseChain.doApply(mockResponse);
        responseChain.write(mockBuffer);
        responseChain.write(mockBuffer);
        responseChain.end();

        verify(mockBodyHandler, times(2)).handle(mockBuffer);
        verify(mockEndHandler, times(1)).handle((Void) null);

        InOrder order = inOrder(policyTwo, policyOne);
        order.verify(policyTwo).apply(mockResponse, mockContext, pwcTwo.getConfiguration(), responseChain);
        order.verify(policyOne).apply(mockResponse, mockContext, pwcOne.getConfiguration(), responseChain);
    }
Test {@link RequestChain} and {@link ResponseChain} functionality.

@author Marc Savy <msavy@redhat.com>
gateway/engine/core/src/test/java/io/apiman/gateway/engine/impl/PolicyChainTest.java