@Test public void testGetMeasuresById() throws Exception { Measure measure = createGriffinMeasure("view_item_hourly"); given(measureRepo.findByIdAndDeleted(1L, false)).willReturn(measure); Measure m = service.getMeasureById(1); assertEquals(m.getName(), measure.getName()); }
@Override public Measure getMeasureById(long id) { Measure measure = measureRepo.findByIdAndDeleted(id, false); if (measure == null) { throw new GriffinException .NotFoundException(MEASURE_ID_DOES_NOT_EXIST); } return measure; }
MeasureServiceImpl implements MeasureService { @Override public Measure getMeasureById(long id) { Measure measure = measureRepo.findByIdAndDeleted(id, false); if (measure == null) { throw new GriffinException .NotFoundException(MEASURE_ID_DOES_NOT_EXIST); } return measure; } }
MeasureServiceImpl implements MeasureService { @Override public Measure getMeasureById(long id) { Measure measure = measureRepo.findByIdAndDeleted(id, false); if (measure == null) { throw new GriffinException .NotFoundException(MEASURE_ID_DOES_NOT_EXIST); } return measure; }  }
MeasureServiceImpl implements MeasureService { @Override public Measure getMeasureById(long id) { Measure measure = measureRepo.findByIdAndDeleted(id, false); if (measure == null) { throw new GriffinException .NotFoundException(MEASURE_ID_DOES_NOT_EXIST); } return 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 Measure getMeasureById(long id) { Measure measure = measureRepo.findByIdAndDeleted(id, false); if (measure == null) { throw new GriffinException .NotFoundException(MEASURE_ID_DOES_NOT_EXIST); } return 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();  }