use of com.linkedin.r2.testutils.filter.RestCountFilter in project rest.li by linkedin.
the class RestFilterTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
_filter = new RestFilter() {
};
_beforeFilter = new RestCountFilter();
_afterFilter = new RestCountFilter();
_fc = FilterChains.createRestChain(_beforeFilter, _filter, _afterFilter);
}
use of com.linkedin.r2.testutils.filter.RestCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testStreamErrorFilter.
@Test
public void testStreamErrorFilter() {
final RestCountFilter restCountFilter = new RestCountFilter();
final StreamCountFilter streamCountFilter = new StreamCountFilter();
FilterChain fc = FilterChains.createRestChain(restCountFilter);
fc = fc.addLast(streamCountFilter);
fireStreamError(fc);
assertRestCounts(0, 0, 0, restCountFilter);
assertStreamCounts(0, 0, 1, streamCountFilter);
}
use of com.linkedin.r2.testutils.filter.RestCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testStreamRequestFilter.
@Test
public void testStreamRequestFilter() {
final RestCountFilter restCountFilter = new RestCountFilter();
final StreamCountFilter streamCountFilter = new StreamCountFilter();
FilterChain fc = FilterChains.createRestChain(restCountFilter);
fc = fc.addLast(streamCountFilter);
fireStreamRequest(fc);
assertRestCounts(0, 0, 0, restCountFilter);
assertStreamCounts(1, 0, 0, streamCountFilter);
}
use of com.linkedin.r2.testutils.filter.RestCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testNullFilterInList.
@Test(expectedExceptions = IllegalArgumentException.class)
public void testNullFilterInList() {
List<RestFilter> restFilters = new ArrayList<>();
restFilters.add(new RestCountFilter());
restFilters.add(null);
FilterChains.create(restFilters, Collections.<StreamFilter>emptyList());
}
use of com.linkedin.r2.testutils.filter.RestCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testChainRestErrorFilters.
@Test
public void testChainRestErrorFilters() {
final RestCountFilter filter1 = new RestCountFilter();
final RestCountFilter filter2 = new RestCountFilter();
final RestCountFilter filter3 = new RestCountFilter();
final FilterChain fc = FilterChains.createRestChain(filter1, filter2, filter3);
fireRestError(fc);
assertRestCounts(0, 0, 1, filter1);
assertRestCounts(0, 0, 1, filter2);
assertRestCounts(0, 0, 1, filter3);
}
Aggregations