protected PolicyFailure createFailurePolicyObject(IPolicyContext context) {
        // Failure
        final PolicyFailure failure = new PolicyFailure();
        Mockito.when(context.getComponent(IPolicyFailureFactoryComponent.class))
                .thenReturn(new IPolicyFailureFactoryComponent() {
                    @Override
                    public PolicyFailure createFailure(PolicyFailureType type, int failureCode,
                            String message) {
                        return failure;
                    }
                });
        return failure;
    }
Base class for all policy tests cases.

@author Wojciech Trocki <wtr@redhat.com>
gateway/engine/policies/src/test/java/io/apiman/gateway/engine/policies/PolicyTestBase.java