Search in sources :

Example 6 with FilterChainDispatcher

use of com.linkedin.restli.internal.server.filter.FilterChainDispatcher in project rest.li by linkedin.

the class TestRestLiCallback method setUp.

@BeforeTest
protected void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    _filterResponseContextFactory = new RestLiFilterResponseContextFactory(_restRequest, _routingResult, _responseHandler);
    when(_routingResult.getContext()).thenReturn(new ResourceContextImpl());
    ErrorResponseBuilder errorResponseBuilder = new ErrorResponseBuilder();
    FilterChainDispatcher filterChainDispatcher = new FilterChainDispatcherImpl(_routingResult, _methodInvoker, _argumentBuilder);
    FilterChainCallback filterChainCallback = new FilterChainCallbackImpl(_routingResult, _responseHandler, _callback, errorResponseBuilder);
    _zeroFilterChain = new RestLiFilterChain(null, filterChainDispatcher, filterChainCallback);
    _oneFilterChain = new RestLiFilterChain(Arrays.asList(_filter), filterChainDispatcher, filterChainCallback);
    _twoFilterChain = new RestLiFilterChain(Arrays.asList(_filter, _filter), filterChainDispatcher, filterChainCallback);
    _noFilterRestLiCallback = new RestLiCallback(_filterRequestContext, _filterResponseContextFactory, _zeroFilterChain);
    _oneFilterRestLiCallback = new RestLiCallback(_filterRequestContext, _filterResponseContextFactory, _oneFilterChain);
    _twoFilterRestLiCallback = new RestLiCallback(_filterRequestContext, _filterResponseContextFactory, _twoFilterChain);
}
Also used : FilterChainCallback(com.linkedin.restli.internal.server.filter.FilterChainCallback) RestLiFilterResponseContextFactory(com.linkedin.restli.internal.server.filter.RestLiFilterResponseContextFactory) FilterChainDispatcher(com.linkedin.restli.internal.server.filter.FilterChainDispatcher) FilterChainDispatcherImpl(com.linkedin.restli.internal.server.filter.FilterChainDispatcherImpl) FilterChainCallbackImpl(com.linkedin.restli.internal.server.filter.FilterChainCallbackImpl) RestLiCallback(com.linkedin.restli.internal.server.RestLiCallback) ResourceContextImpl(com.linkedin.restli.internal.server.ResourceContextImpl) RestLiFilterChain(com.linkedin.restli.internal.server.filter.RestLiFilterChain) BeforeTest(org.testng.annotations.BeforeTest)

Aggregations

FilterChainCallback (com.linkedin.restli.internal.server.filter.FilterChainCallback)6 FilterChainDispatcher (com.linkedin.restli.internal.server.filter.FilterChainDispatcher)6 RestLiFilterChain (com.linkedin.restli.internal.server.filter.RestLiFilterChain)6 RestLiFilterResponseContextFactory (com.linkedin.restli.internal.server.filter.RestLiFilterResponseContextFactory)6 ResourceContextImpl (com.linkedin.restli.internal.server.ResourceContextImpl)5 RestLiCallback (com.linkedin.restli.internal.server.RestLiCallback)5 FilterChainCallbackImpl (com.linkedin.restli.internal.server.filter.FilterChainCallbackImpl)5 FilterChainDispatcherImpl (com.linkedin.restli.internal.server.filter.FilterChainDispatcherImpl)5 RestLiSyntaxException (com.linkedin.restli.internal.server.util.RestLiSyntaxException)5 RestRequest (com.linkedin.r2.message.rest.RestRequest)4 RestRequestBuilder (com.linkedin.r2.message.rest.RestRequestBuilder)4 RoutingResult (com.linkedin.restli.internal.server.RoutingResult)4 ServerResourceContext (com.linkedin.restli.internal.server.ServerResourceContext)4 RestLiResponseHandler (com.linkedin.restli.internal.server.response.RestLiResponseHandler)4 RoutingException (com.linkedin.restli.server.RoutingException)4 FilterRequestContext (com.linkedin.restli.server.filter.FilterRequestContext)4 URI (java.net.URI)4 BeforeTest (org.testng.annotations.BeforeTest)4 Callback (com.linkedin.common.callback.Callback)3 RestException (com.linkedin.r2.message.rest.RestException)3