TenantContextFilter extends OncePerRequestFilter { public void setThrowExceptionOnMissingTenant(boolean throwExceptionOnMissingTenant) { this.throwExceptionOnMissingTenant = throwExceptionOnMissingTenant; } TenantContextFilter(List<TenantIdentificationStrategy> strategies); void setThrowExceptionOnMissingTenant(boolean throwExceptionOnMissingTenant); boolean isThrowExceptionOnMissingTenant();  }
@Test public void whenNoContextFoundThenContextShouldBeNull() throws Exception { this.filter.setThrowExceptionOnMissingTenant(false); when(strategy.getTenant(this.request)).thenReturn(null); this.filter.doFilter(this.request, this.response, new VerifyFilterChain(null)); }