@Test public void testDeleteMeasureByIdForGriffinSuccess() throws Exception { GriffinMeasure measure = createGriffinMeasure("view_item_hourly"); measure.setId(1L); given(measureRepo.findByIdAndDeleted(measure.getId(), false)) .willReturn(measure); doNothing().when(griffinOp).delete(measure); service.deleteMeasureById(measure.getId()); verify(griffinOp, times(1)).delete(measure); }
@Override public void deleteMeasureById(Long measureId) throws SchedulerException { Measure measure = measureRepo.findByIdAndDeleted(measureId, false); if (measure == null) { throw new GriffinException.NotFoundException( MEASURE_ID_DOES_NOT_EXIST); } MeasureOperator op = getOperation(measure); op.delete(measure); }
MeasureServiceImpl implements MeasureService { @Override public void deleteMeasureById(Long measureId) throws SchedulerException { Measure measure = measureRepo.findByIdAndDeleted(measureId, false); if (measure == null) { throw new GriffinException.NotFoundException( MEASURE_ID_DOES_NOT_EXIST); } MeasureOperator op = getOperation(measure); op.delete(measure); } }
MeasureServiceImpl implements MeasureService { @Override public void deleteMeasureById(Long measureId) throws SchedulerException { Measure measure = measureRepo.findByIdAndDeleted(measureId, false); if (measure == null) { throw new GriffinException.NotFoundException( MEASURE_ID_DOES_NOT_EXIST); } MeasureOperator op = getOperation(measure); op.delete(measure); }  }
MeasureServiceImpl implements MeasureService { @Override public void deleteMeasureById(Long measureId) throws SchedulerException { Measure measure = measureRepo.findByIdAndDeleted(measureId, false); if (measure == null) { throw new GriffinException.NotFoundException( MEASURE_ID_DOES_NOT_EXIST); } MeasureOperator op = getOperation(measure); op.delete(measure); }  @Override List<? extends Measure> getAllAliveMeasures(String type); @Override Measure getMeasureById(long id); @Override List<Measure> getAliveMeasuresByOwner(String owner); @Override Measure createMeasure(Measure measure); @Override Measure updateMeasure(Measure measure); @Override void deleteMeasureById(Long measureId); @Override void deleteMeasures(); }
MeasureServiceImpl implements MeasureService { @Override public void deleteMeasureById(Long measureId) throws SchedulerException { Measure measure = measureRepo.findByIdAndDeleted(measureId, false); if (measure == null) { throw new GriffinException.NotFoundException( MEASURE_ID_DOES_NOT_EXIST); } MeasureOperator op = getOperation(measure); op.delete(measure); }  @Override List<? extends Measure> getAllAliveMeasures(String type); @Override Measure getMeasureById(long id); @Override List<Measure> getAliveMeasuresByOwner(String owner); @Override Measure createMeasure(Measure measure); @Override Measure updateMeasure(Measure measure); @Override void deleteMeasureById(Long measureId); @Override void deleteMeasures();  }