Search in sources :

Example 1 with PassthroughDataPolicy

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

the class DataPolicyChainTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    policies = new ArrayList<>();
    policyOne = spy(new PassthroughDataPolicy("1"));
    pwcOne = new PolicyWithConfiguration(policyOne, configuration);
    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");
    mockRequestHandler = mock(IReadWriteStream.class);
    mockResponseHandler = mock(IReadWriteStream.class);
    mockBodyHandler = mock(IAsyncHandler.class);
    mockEndHandler = mock(IAsyncHandler.class);
}
Also used : IApimanBuffer(io.apiman.gateway.engine.io.IApimanBuffer) IReadWriteStream(io.apiman.gateway.engine.io.IReadWriteStream) IPolicyContext(io.apiman.gateway.engine.policy.IPolicyContext) PassthroughDataPolicy(io.apiman.gateway.engine.util.PassthroughDataPolicy) 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 IReadWriteStream (io.apiman.gateway.engine.io.IReadWriteStream)1 IPolicyContext (io.apiman.gateway.engine.policy.IPolicyContext)1 PolicyWithConfiguration (io.apiman.gateway.engine.policy.PolicyWithConfiguration)1 PassthroughDataPolicy (io.apiman.gateway.engine.util.PassthroughDataPolicy)1 Before (org.junit.Before)1