use of com.linkedin.r2.testutils.filter.StreamCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testStreamResponseFilter.
@Test
public void testStreamResponseFilter() {
final RestCountFilter restCountFilter = new RestCountFilter();
final StreamCountFilter streamCountFilter = new StreamCountFilter();
FilterChain fc = FilterChains.createRestChain(restCountFilter);
fc = fc.addLast(streamCountFilter);
fireStreamResponse(fc);
assertRestCounts(0, 0, 0, restCountFilter);
assertStreamCounts(0, 1, 0, streamCountFilter);
}
use of com.linkedin.r2.testutils.filter.StreamCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testChainStreamErrorFilters.
@Test
public void testChainStreamErrorFilters() {
final StreamCountFilter filter1 = new StreamCountFilter();
final StreamCountFilter filter2 = new StreamCountFilter();
final StreamCountFilter filter3 = new StreamCountFilter();
final FilterChain fc = FilterChains.createStreamChain(filter1, filter2, filter3);
fireStreamError(fc);
assertStreamCounts(0, 0, 1, filter1);
assertStreamCounts(0, 0, 1, filter2);
assertStreamCounts(0, 0, 1, filter3);
}
use of com.linkedin.r2.testutils.filter.StreamCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testRestResponseFilter.
@Test
public void testRestResponseFilter() {
final RestCountFilter restCountFilter = new RestCountFilter();
final StreamCountFilter streamCountFilter = new StreamCountFilter();
FilterChain fc = FilterChains.createRestChain(restCountFilter);
fc = fc.addLast(streamCountFilter);
fireRestResponse(fc);
assertRestCounts(0, 1, 0, restCountFilter);
assertStreamCounts(0, 0, 0, streamCountFilter);
}
use of com.linkedin.r2.testutils.filter.StreamCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testRestRequestFilter.
@Test
public void testRestRequestFilter() {
final RestCountFilter restCountFilter = new RestCountFilter();
final StreamCountFilter streamCountFilter = new StreamCountFilter();
FilterChain fc = FilterChains.createRestChain(restCountFilter);
fc = fc.addLast(streamCountFilter);
fireRestRequest(fc);
assertRestCounts(1, 0, 0, restCountFilter);
assertStreamCounts(0, 0, 0, streamCountFilter);
}
use of com.linkedin.r2.testutils.filter.StreamCountFilter in project rest.li by linkedin.
the class TestFilterChainImpl method testChainStreamRequestFilters.
@Test
public void testChainStreamRequestFilters() {
final StreamCountFilter filter1 = new StreamCountFilter();
final StreamCountFilter filter2 = new StreamCountFilter();
final StreamCountFilter filter3 = new StreamCountFilter();
final FilterChain fc = FilterChains.createStreamChain(filter1, filter2, filter3);
fireStreamRequest(fc);
assertStreamCounts(1, 0, 0, filter1);
assertStreamCounts(1, 0, 0, filter2);
assertStreamCounts(1, 0, 0, filter3);
}
Aggregations