@Test public void shouldSaveNewRecords() throws Exception { EquipmentTypeProduct pp = new EquipmentTypeProduct(); service.Save(pp); verify(repository).insert(pp); verify(repository, never()).update(pp); }
public void Save(EquipmentTypeProduct equipmentTypeProduct){ if(equipmentTypeProduct.getId() == null){ repository.insert(equipmentTypeProduct); } else { repository.update(equipmentTypeProduct); } }
ProgramEquipmentTypeProductService { public void Save(EquipmentTypeProduct equipmentTypeProduct){ if(equipmentTypeProduct.getId() == null){ repository.insert(equipmentTypeProduct); } else { repository.update(equipmentTypeProduct); } } }
ProgramEquipmentTypeProductService { public void Save(EquipmentTypeProduct equipmentTypeProduct){ if(equipmentTypeProduct.getId() == null){ repository.insert(equipmentTypeProduct); } else { repository.update(equipmentTypeProduct); } }  }
ProgramEquipmentTypeProductService { public void Save(EquipmentTypeProduct equipmentTypeProduct){ if(equipmentTypeProduct.getId() == null){ repository.insert(equipmentTypeProduct); } else { repository.update(equipmentTypeProduct); } }  List<EquipmentTypeProduct> getByProgramEquipmentId(Long programEquipmentId); void Save(EquipmentTypeProduct equipmentTypeProduct); void remove(Long programEquipmentId); void removeAllByEquipmentProducts(Long programEquipmentId); List<Product> getAvailableProductsToLink(Long programId, Long equipmentId); }
ProgramEquipmentTypeProductService { public void Save(EquipmentTypeProduct equipmentTypeProduct){ if(equipmentTypeProduct.getId() == null){ repository.insert(equipmentTypeProduct); } else { repository.update(equipmentTypeProduct); } }  List<EquipmentTypeProduct> getByProgramEquipmentId(Long programEquipmentId); void Save(EquipmentTypeProduct equipmentTypeProduct); void remove(Long programEquipmentId); void removeAllByEquipmentProducts(Long programEquipmentId); List<Product> getAvailableProductsToLink(Long programId, Long equipmentId);  }