@Test public void shouldGetAll() throws Exception { List<Equipment> expectedEquipments = new ArrayList<Equipment>(); expectedEquipments.add(new Equipment()); when(repository.getAll()).thenReturn(expectedEquipments); List<Equipment> equipments = service.getAll(); verify(repository).getAll(); assertEquals(equipments, expectedEquipments); }
public List<Equipment> getAll(){ return repository.getAll(); }
EquipmentService { public List<Equipment> getAll(){ return repository.getAll(); } }
EquipmentService { public List<Equipment> getAll(){ return repository.getAll(); }  }
EquipmentService { public List<Equipment> getAll(){ return repository.getAll(); }  List<Equipment> getAll(); List<ColdChainEquipment> getAllCCE(Long equipmentTypeId, Pagination page); List<Equipment> getAllByType(Long equipmentTypeId); List<Equipment> getByType(Long equipmentTypeId, Pagination page); Equipment getById(Long id); Equipment getByTypeAndId(Long id,Long equipmentTypeId); List<EquipmentType> getTypesByProgram(Long programId); Integer getEquipmentsCountByType(Long equipmentTypeId); Integer getCCECountByType(Long equipmentTypeId); void saveEquipment(Equipment equipment); void saveColdChainEquipment(ColdChainEquipment coldChainEquipment); void updateEquipment(Equipment equipment); void updateColdChainEquipment(ColdChainEquipment coldChainEquipment); void removeEquipment(Long id); void removeCCE(Long id); }
EquipmentService { public List<Equipment> getAll(){ return repository.getAll(); }  List<Equipment> getAll(); List<ColdChainEquipment> getAllCCE(Long equipmentTypeId, Pagination page); List<Equipment> getAllByType(Long equipmentTypeId); List<Equipment> getByType(Long equipmentTypeId, Pagination page); Equipment getById(Long id); Equipment getByTypeAndId(Long id,Long equipmentTypeId); List<EquipmentType> getTypesByProgram(Long programId); Integer getEquipmentsCountByType(Long equipmentTypeId); Integer getCCECountByType(Long equipmentTypeId); void saveEquipment(Equipment equipment); void saveColdChainEquipment(ColdChainEquipment coldChainEquipment); void updateEquipment(Equipment equipment); void updateColdChainEquipment(ColdChainEquipment coldChainEquipment); void removeEquipment(Long id); void removeCCE(Long id);  }