@Test public void shouldSaveNew() throws Exception { ProgramEquipmentType programEquipmentType = new ProgramEquipmentType(); service.Save(programEquipmentType); verify(repository).insert(programEquipmentType); verify(repository, never()).update(programEquipmentType); }
public void Save(ProgramEquipmentType programEquipmentType) { if (programEquipmentType.getId() == null) { programEquipmentTypeRepository.insert(programEquipmentType); } else { programEquipmentTypeRepository.update(programEquipmentType); } }
ProgramEquipmentTypeService { public void Save(ProgramEquipmentType programEquipmentType) { if (programEquipmentType.getId() == null) { programEquipmentTypeRepository.insert(programEquipmentType); } else { programEquipmentTypeRepository.update(programEquipmentType); } } }
ProgramEquipmentTypeService { public void Save(ProgramEquipmentType programEquipmentType) { if (programEquipmentType.getId() == null) { programEquipmentTypeRepository.insert(programEquipmentType); } else { programEquipmentTypeRepository.update(programEquipmentType); } }  }
ProgramEquipmentTypeService { public void Save(ProgramEquipmentType programEquipmentType) { if (programEquipmentType.getId() == null) { programEquipmentTypeRepository.insert(programEquipmentType); } else { programEquipmentTypeRepository.update(programEquipmentType); } }  List<ProgramEquipmentType> getByProgramId(Long programId); void Save(ProgramEquipmentType programEquipmentType); void remove(Long programEquipmentId); }
ProgramEquipmentTypeService { public void Save(ProgramEquipmentType programEquipmentType) { if (programEquipmentType.getId() == null) { programEquipmentTypeRepository.insert(programEquipmentType); } else { programEquipmentTypeRepository.update(programEquipmentType); } }  List<ProgramEquipmentType> getByProgramId(Long programId); void Save(ProgramEquipmentType programEquipmentType); void remove(Long programEquipmentId);  }