InterceptorCache { Deque<Interceptor> getInterceptors(final String component) { if (componentInterceptors.containsKey(component)) { return new LinkedList<>(componentInterceptors.get(component)); } throw new InterceptorCacheException(format("Component [%s] does not have any cached Interceptors, check if there is an InterceptorChainProvider for this component.", component)); }  @PostConstruct void initialise();  }
@Test public void shouldThrowExceptionIfComponentHasNoInterceptorChainProviderRegistered() throws Exception { expectedException.expect(InterceptorCacheException.class); expectedException.expectMessage("Component [Unknown Component] does not have any cached Interceptors, check if there is an InterceptorChainProvider for this component."); interceptorCache.getInterceptors("Unknown Component"); }