@Test public void shouldUpdateBudgetFileInfoIfExist() throws Exception { BudgetFileInfo budgetFileInfo = new BudgetFileInfo("Budget File", false); budgetFileInfo.setId(1L); service.save(budgetFileInfo); verify(repository).update(budgetFileInfo); }
public void save(BudgetFileInfo budgetFileInfo) { if (budgetFileInfo.getId() != null) { repository.update(budgetFileInfo); } else { repository.insert(budgetFileInfo); } }
BudgetFileService { public void save(BudgetFileInfo budgetFileInfo) { if (budgetFileInfo.getId() != null) { repository.update(budgetFileInfo); } else { repository.insert(budgetFileInfo); } } }
BudgetFileService { public void save(BudgetFileInfo budgetFileInfo) { if (budgetFileInfo.getId() != null) { repository.update(budgetFileInfo); } else { repository.insert(budgetFileInfo); } }  }
BudgetFileService { public void save(BudgetFileInfo budgetFileInfo) { if (budgetFileInfo.getId() != null) { repository.update(budgetFileInfo); } else { repository.insert(budgetFileInfo); } }  void save(BudgetFileInfo budgetFileInfo); }
BudgetFileService { public void save(BudgetFileInfo budgetFileInfo) { if (budgetFileInfo.getId() != null) { repository.update(budgetFileInfo); } else { repository.insert(budgetFileInfo); } }  void save(BudgetFileInfo budgetFileInfo);  }