@Test public void testDeleteForSuccess() throws Exception { Measure measure = createGriffinMeasure("view_item_hourly"); measure.setId(1L); doNothing().when(jobService).deleteJobsRelateToMeasure(1L); given(measureRepo.save(measure)).willReturn(measure); operator.update(measure); verify(measureRepo, times(1)).save(measure); }
@Override public Measure update(Measure measure) { validateMeasure(measure); measure.setDeleted(false); measure = measureRepo.save(measure); return measure; }
GriffinMeasureOperatorImpl implements MeasureOperator { @Override public Measure update(Measure measure) { validateMeasure(measure); measure.setDeleted(false); measure = measureRepo.save(measure); return measure; } }
GriffinMeasureOperatorImpl implements MeasureOperator { @Override public Measure update(Measure measure) { validateMeasure(measure); measure.setDeleted(false); measure = measureRepo.save(measure); return measure; } @Autowired  GriffinMeasureOperatorImpl(MeasureRepo<Measure> measureRepo,
                                      JobServiceImpl jobService); }
GriffinMeasureOperatorImpl implements MeasureOperator { @Override public Measure update(Measure measure) { validateMeasure(measure); measure.setDeleted(false); measure = measureRepo.save(measure); return 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 Measure update(Measure measure) { validateMeasure(measure); measure.setDeleted(false); measure = measureRepo.save(measure); return measure; } @Autowired  GriffinMeasureOperatorImpl(MeasureRepo<Measure> measureRepo,
                                      JobServiceImpl jobService); @Override Measure create(Measure measure); @Override Measure update(Measure measure); @Override void delete(Measure measure);  }