@Test public void shouldSaveChangesInExistingEquipment() throws Exception { Equipment equipment = new Equipment(); equipment.setId(1L); equipment.setName("123"); service.updateEquipment(equipment); verify(repository, never()).insert(equipment); verify(repository).update(equipment); }
public void updateEquipment(Equipment equipment) { repository.update(equipment); }
EquipmentService { public void updateEquipment(Equipment equipment) { repository.update(equipment); } }
EquipmentService { public void updateEquipment(Equipment equipment) { repository.update(equipment); }  }
EquipmentService { public void updateEquipment(Equipment equipment) { repository.update(equipment); }  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 void updateEquipment(Equipment equipment) { repository.update(equipment); }  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);  }