@Override
  public void init(InitContext context) {
    String state = context.generateCsrfState();
    try (OAuth20Service scribe = scribeFactory.newScribe(gitLabSettings, context.getCallbackUrl(), scribeApi)) {
      String url = scribe.getAuthorizationUrl(state);
      context.redirectTo(url);
    } catch (IOException e) {
      throw new IllegalStateException(e);
    }
  }
@Test
  public void init_whenSuccessful_redirectsToUrl() {
    gitLabIdentityProvider.init(initContext);

    verify(initContext).generateCsrfState();
    verify(initContext).redirectTo(AUTHORIZATION_URL);
  }