@Override
  public void callback(CallbackContext context) {
    try {
      onCallback(context);
    } catch (IOException | ExecutionException e) {
      throw new IllegalStateException(e);
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new IllegalStateException(e);
    }
  }
@Test
  public void callback_whenOrganizationsAreNotDefinedAndUserDoesntBelongToInstallationOrganization_shouldThrow() throws IOException, ExecutionException, InterruptedException {
    UserIdentity userIdentity = mock(UserIdentity.class);
    CallbackContext context = mockUserNotBelongingToOrganization(userIdentity);

    mockInstallations();

    assertThatThrownBy(() -> underTest.callback(context))
      .isInstanceOf(UnauthorizedException.class)
      .hasMessage("'login' must be a member of at least one organization which has installed the SonarQube GitHub app");
  }