@Test
  public void getMapForNull() {
    MetricFetcher fetcher =
        new MetricFetcher(
            mock(ActorSystem.class), mock(JobManagerRetriever.class), mock(ExecutionContext.class));
    MetricStore store = fetcher.getMetricStore();

    TaskManagerMetricsHandler handler = new TaskManagerMetricsHandler(fetcher);

    Map<String, String> pathParams = new HashMap<>();

    Map<String, Object> metrics = handler.getMapFor(pathParams, store);

    assertNull(metrics);
  }
  @Test
  public void getMapFor() throws Exception {
    MetricFetcher fetcher =
        new MetricFetcher(
            mock(ActorSystem.class), mock(JobManagerRetriever.class), mock(ExecutionContext.class));
    MetricStore store = MetricStoreTest.setupStore(fetcher.getMetricStore());

    TaskManagerMetricsHandler handler = new TaskManagerMetricsHandler(fetcher);

    Map<String, String> pathParams = new HashMap<>();
    pathParams.put(PARAMETER_TM_ID, "tmid");

    Map<String, Object> metrics = handler.getMapFor(pathParams, store);

    assertEquals(1L, metrics.get("abc.metric2"));
  }