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

        requestChain = new RequestChain(policies, mockContext);

        IAsyncHandler<Throwable> mThrowableFailureHandler = mock(IAsyncHandler.class);

        Throwable mThrowable = mock(Throwable.class);

        requestChain.policyErrorHandler(mThrowableFailureHandler);
        requestChain.bodyHandler(mockBodyHandler);
        requestChain.endHandler(mockEndHandler);

        requestChain.doApply(mockRequest);
        requestChain.throwError(mThrowable);

        verify(mThrowableFailureHandler).handle(mThrowable);
    }
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