@Override
  public void run() {
    try (DbSession dbSession = dbClient.openSession(false)) {
      int size = dbClient.ceQueueDao().countByStatus(dbSession, CeQueueDto.Status.PENDING);
      metrics.setNumberOfPendingTasks(size);
    }
  }
@Test
  public void run_setsValueInMetricsBasedOnValueReturnedFromDatabase() {
    NumberOfTasksInQueueTask task = new NumberOfTasksInQueueTask(dbClient, metrics, config);
    when(dbClient.ceQueueDao()).thenReturn(ceQueueDao);
    when(ceQueueDao.countByStatus(any(), any())).thenReturn(10);

    task.run();

    verify(metrics, times(1)).setNumberOfPendingTasks(10);
  }