@Test
public void testTranslate() throws IOException {

    String json = readFile("/violation_t4c.json");
    IConstraintEvaluator constraintEvaluator = new SimpleConstraintEvaluator();
    
    Tower4CloudsTranslator translator = new Tower4CloudsTranslator(constraintEvaluator);
    Agreement agreement = new Agreement();
    GuaranteeTerm term = new GuaranteeTerm();
    term.setKpiName("responsetime");
    term.setName("rt");
    term.setServiceLevel("AverageDatabaseCPUUtilizationViolated NOT_EXISTS");
    agreement.setGuaranteeTerms(Arrays.asList(new IGuaranteeTerm[] { term}));
    
    Map<IGuaranteeTerm, List<IMonitoringMetric>> map = translator.translate(agreement, json);
    
    assertEquals(1, map.get(term).size());
    IMonitoringMetric item = map.get(term).get(0);
    assertEquals(1435136856709L, item.getDate().getTime());
    assertEquals("AverageDatabaseCPUUtilizationViolated", item.getMetricKey());
    assertEquals("0.022784559188465933e0", item.getMetricValue());
}