Search in sources :

Example 11 with StreamCountFilter

use of com.linkedin.r2.testutils.filter.StreamCountFilter in project rest.li by linkedin.

the class TestFilterChainImpl method testRestErrorFilter.

@Test
public void testRestErrorFilter() {
    final RestCountFilter restCountFilter = new RestCountFilter();
    final StreamCountFilter streamCountFilter = new StreamCountFilter();
    FilterChain fc = FilterChains.createRestChain(restCountFilter);
    fc = fc.addLast(streamCountFilter);
    fireRestError(fc);
    assertRestCounts(0, 0, 1, restCountFilter);
    assertStreamCounts(0, 0, 0, streamCountFilter);
}
Also used : StreamCountFilter(com.linkedin.r2.testutils.filter.StreamCountFilter) FilterChain(com.linkedin.r2.filter.FilterChain) RestCountFilter(com.linkedin.r2.testutils.filter.RestCountFilter) Test(org.testng.annotations.Test)

Aggregations

StreamCountFilter (com.linkedin.r2.testutils.filter.StreamCountFilter)11 FilterChain (com.linkedin.r2.filter.FilterChain)10 Test (org.testng.annotations.Test)10 RestCountFilter (com.linkedin.r2.testutils.filter.RestCountFilter)6 StreamFilter (com.linkedin.r2.filter.message.stream.StreamFilter)1 RequestContext (com.linkedin.r2.message.RequestContext)1 RestRequest (com.linkedin.r2.message.rest.RestRequest)1 RestRequestBuilder (com.linkedin.r2.message.rest.RestRequestBuilder)1 RestResponse (com.linkedin.r2.message.rest.RestResponse)1 RestResponseBuilder (com.linkedin.r2.message.rest.RestResponseBuilder)1 CaptureLastCallFilter (com.linkedin.r2.testutils.filter.CaptureLastCallFilter)1 Path (java.nio.file.Path)1 BeforeMethod (org.testng.annotations.BeforeMethod)1