@Test
public void shouldProcessesDispatcherThatReturnsNull() throws Exception {

    final JsonEnvelope inputEnvelope = mock(JsonEnvelope.class);
    final JsonEnvelope outputEnvelope = mock(JsonEnvelope.class);
    final InterceptorContext interceptorContext = interceptorContextWithInput(inputEnvelope);
    final String component = "component";
    when(interceptorCache.getInterceptors(component)).thenReturn(interceptors());
    when(dispatch.apply(inputEnvelope)).thenReturn(null);
    final DefaultInterceptorChainProcessor interceptorChainProcessor = new DefaultInterceptorChainProcessor(interceptorCache, dispatch, component);
    final Optional<JsonEnvelope> result = interceptorChainProcessor.process(interceptorContext);
    assertThat(result, is(Optional.empty()));
}