@Test(expected = GriffinException.ServiceException.class) public void testDeleteForFailureWithPauseJob() throws Exception { Measure measure = createGriffinMeasure("view_item_hourly"); measure.setId(1L); doThrow(new GriffinException.ServiceException("Service exception", new RuntimeException())) .when(jobService).deleteJobsRelateToMeasure(1L); operator.delete(measure); }
@Override public void delete(Measure measure) throws SchedulerException { jobService.deleteJobsRelateToMeasure(measure.getId()); measure.setDeleted(true); measureRepo.save(measure); }
GriffinMeasureOperatorImpl implements MeasureOperator { @Override public void delete(Measure measure) throws SchedulerException { jobService.deleteJobsRelateToMeasure(measure.getId()); measure.setDeleted(true); measureRepo.save(measure); } }
GriffinMeasureOperatorImpl implements MeasureOperator { @Override public void delete(Measure measure) throws SchedulerException { jobService.deleteJobsRelateToMeasure(measure.getId()); measure.setDeleted(true); measureRepo.save(measure); } @Autowired  GriffinMeasureOperatorImpl(MeasureRepo<Measure> measureRepo,
                                      JobServiceImpl jobService); }
GriffinMeasureOperatorImpl implements MeasureOperator { @Override public void delete(Measure measure) throws SchedulerException { jobService.deleteJobsRelateToMeasure(measure.getId()); measure.setDeleted(true); measureRepo.save(measure); } @Autowired  GriffinMeasureOperatorImpl(MeasureRepo<Measure> measureRepo,
                                      JobServiceImpl jobService); @Override Measure create(Measure measure); @Override Measure update(Measure measure); @Override void delete(Measure measure); }
GriffinMeasureOperatorImpl implements MeasureOperator { @Override public void delete(Measure measure) throws SchedulerException { jobService.deleteJobsRelateToMeasure(measure.getId()); measure.setDeleted(true); measureRepo.save(measure); } @Autowired  GriffinMeasureOperatorImpl(MeasureRepo<Measure> measureRepo,
                                      JobServiceImpl jobService); @Override Measure create(Measure measure); @Override Measure update(Measure measure); @Override void delete(Measure measure);  }