@Override
  public void init(FilterConfig config) {
    // Filters are already available in the container unless a database migration is required. See
    // org.sonar.server.startup.RegisterServletFilters.
    List<ServletFilter> servletFilterList = PlatformImpl.getInstance().getContainer().getComponentsByType(ServletFilter.class);
    List<HttpFilter> httpFilterList = PlatformImpl.getInstance().getContainer().getComponentsByType(HttpFilter.class);
    init(config, servletFilterList, httpFilterList);
  }
@Test
  public void should_propagate_initialization_failure() throws Exception {
    ServletFilter filter = createMockServletFilter();
    doThrow(new IllegalStateException("foo")).when(filter).init(any(FilterConfig.class));

    FilterConfig config = mock(FilterConfig.class);
    MasterServletFilter filters = new MasterServletFilter();

    List<ServletFilter> servletFilters = singletonList(filter);
    List<HttpFilter> httpFilters = emptyList();
    assertThatThrownBy(() -> filters.init(config, servletFilters, httpFilters))
      .isInstanceOf(IllegalStateException.class)
      .hasMessageContaining("foo");
  }