@Test
public void testDownsampleWithFillDefaultValues() {

    Transform downsampleTransform = new DownsampleTransform();
    Map<Long, Double> datapoints_1 = new HashMap<Long, Double>();
    long startMillis = 1534368960000L; 
    datapoints_1.put(startMillis, 1.0);
    datapoints_1.put(startMillis+60000L, 1.0);
    datapoints_1.put(startMillis+2*60000L, 2.0);
    datapoints_1.put(startMillis+3*60000L, 3.0);
    datapoints_1.put(startMillis+4*60000L, 4.0);
    datapoints_1.put(startMillis+7*60000L, 7.0);
    datapoints_1.put(startMillis+8*60000L, 8.0);
    Metric metric_1 = new Metric(TEST_SCOPE + "1", TEST_METRIC);
    metric_1.setDatapoints(datapoints_1);
    List<Metric> metrics = new ArrayList<Metric>();
    metrics.add(metric_1);
    List<String> constants = new ArrayList<String>();
    constants.add("1m-sum");
    constants.add("-10m");
    constants.add("-0m");
    constants.add("0.0");
    Map<Long, Double> expected_1 = new HashMap<Long, Double>();
    expected_1.put(startMillis, 1.0);
    expected_1.put(startMillis+60000L, 1.0);
    expected_1.put(startMillis+2*60000L, 2.0);
    expected_1.put(startMillis+3*60000L, 3.0);
    expected_1.put(startMillis+4*60000L, 4.0);
    expected_1.put(startMillis+5*60000L, 0.0);
    expected_1.put(startMillis+6*60000L, 0.0);
    expected_1.put(startMillis+7*60000L, 7.0);
    expected_1.put(startMillis+8*60000L, 8.0);
    expected_1.put(startMillis+9*60000L, 0.0);
    List<Metric> result = downsampleTransform.transform(null, metrics, constants);
    assertEquals(result.size(), 1);
    assertEquals(expected_1, result.get(0).getDatapoints());
}