@Test
public void test_shouldReturnIntegralForOneMetric() {

    Transform integralTransform = new MetricMappingTransform(new IntegralValueMapping());
    Metric m1 = new Metric("test_scope", "test_metric");
    Map<Long, Double> dp = new HashMap<Long, Double>();
    dp.put(2L, 3.0);
    dp.put(4L, 5.0);
    dp.put(5L, 2.2);
    m1.setDatapoints(dp);
    List<Metric> metrics = Arrays.asList(m1);
    List<Metric> result = integralTransform.transform(null, metrics);
    assertThat(result, equalTo(metrics));
    Map<Long, Double> expectedDps = new HashMap<Long, Double>();
    expectedDps.put(2L, 3.0);
    expectedDps.put(4L, 8.0);
    expectedDps.put(5L, 10.2);
    assertThat(result.get(0).getDatapoints(), equalTo(expectedDps));
}