@Test(expected = GriffinException.BadRequestException.class) public void testUpdateForFailureWithBlankMetricName() { String measureName = "view_item_hourly"; ExternalMeasure measure = createExternalMeasure(measureName); measure.setMetricName(" "); operator.update(measure); }
@Override public Measure update(Measure measure) { ExternalMeasure latestMeasure = (ExternalMeasure) measure; validateMeasure(latestMeasure); ExternalMeasure originMeasure = measureRepo.findOne( latestMeasure.getId()); VirtualJob vj = genVirtualJob(latestMeasure, originMeasure.getVirtualJob()); latestMeasure.setVirtualJob(vj); measure = measureRepo.save(latestMeasure); return measure; }
ExternalMeasureOperatorImpl implements MeasureOperator { @Override public Measure update(Measure measure) { ExternalMeasure latestMeasure = (ExternalMeasure) measure; validateMeasure(latestMeasure); ExternalMeasure originMeasure = measureRepo.findOne( latestMeasure.getId()); VirtualJob vj = genVirtualJob(latestMeasure, originMeasure.getVirtualJob()); latestMeasure.setVirtualJob(vj); measure = measureRepo.save(latestMeasure); return measure; } }
ExternalMeasureOperatorImpl implements MeasureOperator { @Override public Measure update(Measure measure) { ExternalMeasure latestMeasure = (ExternalMeasure) measure; validateMeasure(latestMeasure); ExternalMeasure originMeasure = measureRepo.findOne( latestMeasure.getId()); VirtualJob vj = genVirtualJob(latestMeasure, originMeasure.getVirtualJob()); latestMeasure.setVirtualJob(vj); measure = measureRepo.save(latestMeasure); return measure; }  }
ExternalMeasureOperatorImpl implements MeasureOperator { @Override public Measure update(Measure measure) { ExternalMeasure latestMeasure = (ExternalMeasure) measure; validateMeasure(latestMeasure); ExternalMeasure originMeasure = measureRepo.findOne( latestMeasure.getId()); VirtualJob vj = genVirtualJob(latestMeasure, originMeasure.getVirtualJob()); latestMeasure.setVirtualJob(vj); measure = measureRepo.save(latestMeasure); return measure; }  @Override @Transactional Measure create(Measure measure); @Override Measure update(Measure measure); @Override void delete(Measure measure); }
ExternalMeasureOperatorImpl implements MeasureOperator { @Override public Measure update(Measure measure) { ExternalMeasure latestMeasure = (ExternalMeasure) measure; validateMeasure(latestMeasure); ExternalMeasure originMeasure = measureRepo.findOne( latestMeasure.getId()); VirtualJob vj = genVirtualJob(latestMeasure, originMeasure.getVirtualJob()); latestMeasure.setVirtualJob(vj); measure = measureRepo.save(latestMeasure); return measure; }  @Override @Transactional Measure create(Measure measure); @Override Measure update(Measure measure); @Override void delete(Measure measure);  }