@Override
  public void run() {
    try (DbSession dbSession = dbClient.openSession(false)) {
      List<AlmSettingDto> githubSettingsDtos = dbClient.almSettingDao().selectByAlm(dbSession, ALM.GITHUB);

      if (githubSettingsDtos.isEmpty()) {
        metrics.setGithubStatusToRed();
        return;
      }

      validateGithub(githubSettingsDtos);
    }
  }
@Test
  public void run_githubValidatorDoesntThrowException_setRedStatusInMetricsOnce() {
    List<AlmSettingDto> dtos = generateDtos(5, ALM.GITHUB);
    when(almSettingsDao.selectByAlm(any(), any())).thenReturn(dtos);

    doThrow(new RuntimeException()).when(githubValidator).validate(any());

    underTest.run();

    verify(metrics, times(0)).setGithubStatusToGreen();
    verify(metrics, times(1)).setGithubStatusToRed();
  }