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

      if (gitlabSettingsDtos.isEmpty()) {
        metrics.setGitlabStatusToRed();
        return;
      }

      validateGitlab(gitlabSettingsDtos);
    }
  }
@Test
  public void run_gitlabValidatorDoesntThrowException_setGreenStatusInMetricsOnce() {
    List<AlmSettingDto> dtos = generateDtos(5, ALM.GITLAB);
    when(almSettingsDao.selectByAlm(any(), any())).thenReturn(dtos);

    underTest.run();

    verify(metrics, times(1)).setGitlabStatusToGreen();
    verify(metrics, times(0)).setGitlabStatusToRed();
  }