@Override
  public void run() {
    updateElasticSearchHealthStatus();
    updateFileSystemMetrics();
  }
@Test
  public void elasticsearch_free_disk_space_is_updated() throws IOException {
    URL esNodeResponseUrl = getClass().getResource("es-node-response.json");
    String jsonPayload = StringUtils.trim(IOUtils.toString(esNodeResponseUrl, StandardCharsets.UTF_8));

    JsonObject jsonObject = new Gson().fromJson(jsonPayload, JsonObject.class);
    NodeStatsResponse nodeStats = NodeStatsResponse.toNodeStatsResponse(jsonObject);

    when(esClient.nodesStats()).thenReturn(nodeStats);

    underTest.run();

    String nodeName = nodeStats.getNodeStats().get(0).getName();
    verify(serverMonitoringMetrics, times(1)).setElasticSearchDiskSpaceFreeBytes(nodeName, 136144027648L);
    verify(serverMonitoringMetrics, times(1)).setElasticSearchDiskSpaceTotalBytes(nodeName, 250685575168L);

    // elasticsearch health status is not mocked in this test, so this part raise an exception
    assertThat(logTester.logs()).hasSize(1);
    assertThat(logTester.logs(Level.ERROR)).containsOnly("Failed to query ES status");
  }