@Override
  public void doFilter(HttpRequest request, HttpResponse response, FilterChain chain) {
    IdentityProvider provider = resolveProviderOrHandleResponse(request, response, INIT_CONTEXT);
    if (provider != null) {
      handleProvider(request, response, provider);
    }
  }
@Test
  public void fail_if_identity_provider_class_is_unsupported() throws Exception {
    String unsupportedKey = "unsupported";
    when(request.getRequestURI()).thenReturn("/sessions/init/" + unsupportedKey);
    IdentityProvider identityProvider = new UnsupportedIdentityProvider(unsupportedKey);
    identityProviderRepository.addIdentityProvider(identityProvider);

    underTest.doFilter(request, response, chain);

    assertError("Unsupported IdentityProvider class: class org.sonar.server.authentication.InitFilterTest$UnsupportedIdentityProvider");
    verifyNoInteractions(authenticationEvent);
    verifyNoInteractions(auth2AuthenticationParameters);
  }