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