@Test public void testGetAllMeasures() throws Exception { Measure measure = createGriffinMeasure("view_item_hourly"); given(measureRepo.findByDeleted(false)).willReturn(Collections .singletonList(measure)); List<? extends Measure> measures = service.getAllAliveMeasures(""); assertEquals(measures.size(), 1); assertEquals(measures.get(0).getName(), "view_item_hourly"); }
@Override public List<? extends Measure> getAllAliveMeasures(String type) { if (type.equals(GRIFFIN)) { return griffinMeasureRepo.findByDeleted(false); } else if (type.equals(EXTERNAL)) { return externalMeasureRepo.findByDeleted(false); } return measureRepo.findByDeleted(false); }
MeasureServiceImpl implements MeasureService { @Override public List<? extends Measure> getAllAliveMeasures(String type) { if (type.equals(GRIFFIN)) { return griffinMeasureRepo.findByDeleted(false); } else if (type.equals(EXTERNAL)) { return externalMeasureRepo.findByDeleted(false); } return measureRepo.findByDeleted(false); } }
MeasureServiceImpl implements MeasureService { @Override public List<? extends Measure> getAllAliveMeasures(String type) { if (type.equals(GRIFFIN)) { return griffinMeasureRepo.findByDeleted(false); } else if (type.equals(EXTERNAL)) { return externalMeasureRepo.findByDeleted(false); } return measureRepo.findByDeleted(false); }  }
MeasureServiceImpl implements MeasureService { @Override public List<? extends Measure> getAllAliveMeasures(String type) { if (type.equals(GRIFFIN)) { return griffinMeasureRepo.findByDeleted(false); } else if (type.equals(EXTERNAL)) { return externalMeasureRepo.findByDeleted(false); } return measureRepo.findByDeleted(false); }  @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 List<? extends Measure> getAllAliveMeasures(String type) { if (type.equals(GRIFFIN)) { return griffinMeasureRepo.findByDeleted(false); } else if (type.equals(EXTERNAL)) { return externalMeasureRepo.findByDeleted(false); } return measureRepo.findByDeleted(false); }  @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();  }