@Test
    public void shouldPreserveBufferOrder() {
        policies.add(pwcOne);
        requestChain = new RequestChain(policies, mockContext);
        requestChain.bodyHandler(mockBodyHandler);
        requestChain.endHandler(mockEndHandler);

        requestChain.doApply(mockRequest);

        IApimanBuffer buffer1 = mock(IApimanBuffer.class);
        IApimanBuffer buffer2 = mock(IApimanBuffer.class);
        IApimanBuffer buffer3 = mock(IApimanBuffer.class);

        requestChain.write(buffer1);
        requestChain.write(buffer2);
        requestChain.write(buffer3);

        requestChain.end();

        InOrder order = inOrder(mockBodyHandler, mockEndHandler);
        order.verify(mockBodyHandler).handle(buffer1);
        order.verify(mockBodyHandler).handle(buffer2);
        order.verify(mockBodyHandler).handle(buffer3);
        order.verify(mockEndHandler).handle((Void) null);
    }
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