@Test public void shouldInsertNewAdjustmentReasonProgram() throws Exception { service.saveAdjustmentReasonProgram(newReasonProgram); verify(repository).insertAdjustmentReasonProgram(newReasonProgram); verify(repository, never()).updateAdjustmentReasonProgram(newReasonProgram); }
public void saveAdjustmentReasonProgram(StockAdjustmentReasonProgram entry) { if (entry.getId() != null) { repository.updateAdjustmentReasonProgram(entry); } else { repository.insertAdjustmentReasonProgram(entry); } }
StockAdjustmentReasonService { public void saveAdjustmentReasonProgram(StockAdjustmentReasonProgram entry) { if (entry.getId() != null) { repository.updateAdjustmentReasonProgram(entry); } else { repository.insertAdjustmentReasonProgram(entry); } } }
StockAdjustmentReasonService { public void saveAdjustmentReasonProgram(StockAdjustmentReasonProgram entry) { if (entry.getId() != null) { repository.updateAdjustmentReasonProgram(entry); } else { repository.insertAdjustmentReasonProgram(entry); } }  }
StockAdjustmentReasonService { public void saveAdjustmentReasonProgram(StockAdjustmentReasonProgram entry) { if (entry.getId() != null) { repository.updateAdjustmentReasonProgram(entry); } else { repository.insertAdjustmentReasonProgram(entry); } }  List<StockAdjustmentReason> getAdjustmentReasons(Boolean additive,
                                                          Long programId,
                                                          StockAdjustmentReason.Category category); StockAdjustmentReason getAdjustmentReasonByName(String name); void saveAdjustmentReason(StockAdjustmentReason reason); StockAdjustmentReasonProgram getAdjustmentReasonProgram(String programCode, String reasonName); void saveAdjustmentReasonProgram(StockAdjustmentReasonProgram entry); }
StockAdjustmentReasonService { public void saveAdjustmentReasonProgram(StockAdjustmentReasonProgram entry) { if (entry.getId() != null) { repository.updateAdjustmentReasonProgram(entry); } else { repository.insertAdjustmentReasonProgram(entry); } }  List<StockAdjustmentReason> getAdjustmentReasons(Boolean additive,
                                                          Long programId,
                                                          StockAdjustmentReason.Category category); StockAdjustmentReason getAdjustmentReasonByName(String name); void saveAdjustmentReason(StockAdjustmentReason reason); StockAdjustmentReasonProgram getAdjustmentReasonProgram(String programCode, String reasonName); void saveAdjustmentReasonProgram(StockAdjustmentReasonProgram entry);  }