Search in sources :

Example 1 with PassthroughPolicy

use of io.apiman.gateway.engine.util.PassthroughPolicy in project apiman by apiman.

the class PolicyChainTest method setup.

@Before
public void setup() {
    policies = new ArrayList<>();
    policyOne = spy(new PassthroughPolicy("1"));
    policyTwo = spy(new PassthroughPolicy("2"));
    pwcOne = new PolicyWithConfiguration(policyOne, new Object());
    pwcTwo = new PolicyWithConfiguration(policyTwo, new Object());
    // mockChain = mock(IPolicyChain.class);
    mockContext = mock(IPolicyContext.class);
    mockRequest = mock(ApiRequest.class);
    given(mockRequest.getApiKey()).willReturn("bacon");
    given(mockRequest.getDestination()).willReturn("mars");
    given(mockRequest.getType()).willReturn("request");
    mockResponse = mock(ApiResponse.class);
    given(mockRequest.getApiKey()).willReturn("bacon");
    given(mockRequest.getDestination()).willReturn("mars");
    given(mockRequest.getType()).willReturn("response");
    mockBuffer = mock(IApimanBuffer.class);
    given(mockBuffer.toString()).willReturn("bananas");
    mockBodyHandler = mock(IAsyncHandler.class);
    mockEndHandler = mock(IAsyncHandler.class);
}
Also used : IApimanBuffer(io.apiman.gateway.engine.io.IApimanBuffer) IPolicyContext(io.apiman.gateway.engine.policy.IPolicyContext) PassthroughPolicy(io.apiman.gateway.engine.util.PassthroughPolicy) ApiRequest(io.apiman.gateway.engine.beans.ApiRequest) PolicyWithConfiguration(io.apiman.gateway.engine.policy.PolicyWithConfiguration) IAsyncHandler(io.apiman.gateway.engine.async.IAsyncHandler) ApiResponse(io.apiman.gateway.engine.beans.ApiResponse) Before(org.junit.Before)

Aggregations

IAsyncHandler (io.apiman.gateway.engine.async.IAsyncHandler)1 ApiRequest (io.apiman.gateway.engine.beans.ApiRequest)1 ApiResponse (io.apiman.gateway.engine.beans.ApiResponse)1 IApimanBuffer (io.apiman.gateway.engine.io.IApimanBuffer)1 IPolicyContext (io.apiman.gateway.engine.policy.IPolicyContext)1 PolicyWithConfiguration (io.apiman.gateway.engine.policy.PolicyWithConfiguration)1 PassthroughPolicy (io.apiman.gateway.engine.util.PassthroughPolicy)1 Before (org.junit.Before)1