use of com.netflix.zuul.FilterUsageNotifier in project zuul by Netflix.
the class ZuulFilterChainRunnerTest method testInboundFilterChain.
@Test
public void testInboundFilterChain() {
final SimpleInboundFilter inbound1 = spy(new SimpleInboundFilter(true));
final SimpleInboundFilter inbound2 = spy(new SimpleInboundFilter(false));
final ZuulFilter[] filters = new ZuulFilter[] { inbound1, inbound2 };
final FilterUsageNotifier notifier = mock(FilterUsageNotifier.class);
final Registry registry = mock(Registry.class);
final ZuulFilterChainRunner runner = new ZuulFilterChainRunner(filters, notifier, registry);
runner.filter(request);
verify(inbound1, times(1)).applyAsync(eq(request));
verify(inbound2, never()).applyAsync(eq(request));
verify(notifier).notify(eq(inbound1), eq(ExecutionStatus.SUCCESS));
verify(notifier).notify(eq(inbound2), eq(ExecutionStatus.SKIPPED));
verifyNoMoreInteractions(notifier);
}
use of com.netflix.zuul.FilterUsageNotifier in project zuul by Netflix.
the class ZuulFilterChainRunnerTest method testOutboundFilterChain.
@Test
public void testOutboundFilterChain() {
final SimpleOutboundFilter outbound1 = spy(new SimpleOutboundFilter(true));
final SimpleOutboundFilter outbound2 = spy(new SimpleOutboundFilter(false));
final ZuulFilter[] filters = new ZuulFilter[] { outbound1, outbound2 };
final FilterUsageNotifier notifier = mock(FilterUsageNotifier.class);
final Registry registry = mock(Registry.class);
final ZuulFilterChainRunner runner = new ZuulFilterChainRunner(filters, notifier, registry);
runner.filter(response);
verify(outbound1, times(1)).applyAsync(any());
verify(outbound2, never()).applyAsync(any());
verify(notifier).notify(eq(outbound1), eq(ExecutionStatus.SUCCESS));
verify(notifier).notify(eq(outbound2), eq(ExecutionStatus.SKIPPED));
verifyNoMoreInteractions(notifier);
}
Aggregations