@Test
public void testUpdate() throws Exception {

  Metric metric = new Metric();
  metric.setId("test_application_1234");
  metric.setKey("test_score");
  metric.setValue((float) 0.666667);
  metric.setWorkerIndex("test_worker-2");
  metric.setTimestamp(new BigInteger("1569139525098"));
  metric.setStep(0);
  metric.setIsNan(false);
  boolean result = metricService.insert(metric);
  assertTrue(result);
  metric.setId("test_application_1234");
  metric.setKey("test_scoreNew");
  metric.setValue((float) 0.766667);
  metric.setWorkerIndex("test_worker-New");
  metric.setTimestamp(new BigInteger("2569139525098"));
  metric.setStep(1);
  metric.setIsNan(true);
  boolean editResult = metricService.update(metric);
  assertTrue(editResult);
  Metric metricDb2 = metricService.selectByPrimaryKeySelective(metric).get(0);
  compareMetrics(metric, metricDb2);
}