@Test public void shouldInsertNewAdjustmentReason() throws Exception { service.saveAdjustmentReason(newReason); verify(repository).insertAdjustmentReason(newReason); }
public void saveAdjustmentReason(StockAdjustmentReason reason) { if (getAdjustmentReasonByName(reason.getName()) != null) { throw new DataException("error.stock.adjustment.reason.exists"); } else { repository.insertAdjustmentReason(reason); } }
StockAdjustmentReasonService { public void saveAdjustmentReason(StockAdjustmentReason reason) { if (getAdjustmentReasonByName(reason.getName()) != null) { throw new DataException("error.stock.adjustment.reason.exists"); } else { repository.insertAdjustmentReason(reason); } } }
StockAdjustmentReasonService { public void saveAdjustmentReason(StockAdjustmentReason reason) { if (getAdjustmentReasonByName(reason.getName()) != null) { throw new DataException("error.stock.adjustment.reason.exists"); } else { repository.insertAdjustmentReason(reason); } }  }
StockAdjustmentReasonService { public void saveAdjustmentReason(StockAdjustmentReason reason) { if (getAdjustmentReasonByName(reason.getName()) != null) { throw new DataException("error.stock.adjustment.reason.exists"); } else { repository.insertAdjustmentReason(reason); } }  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 saveAdjustmentReason(StockAdjustmentReason reason) { if (getAdjustmentReasonByName(reason.getName()) != null) { throw new DataException("error.stock.adjustment.reason.exists"); } else { repository.insertAdjustmentReason(reason); } }  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);  }