@Test public void testAddBudgetPerson() throws Exception { assertTrue(budget.getBudgetPersons().isEmpty()); BudgetPerson testPerson = new BudgetPerson(); testPerson.setPersonId(testOtherPersonId); budgetPersonService.addBudgetPerson(budget, testPerson); assertTrue(budget.getBudgetPersons().size() == 1); }
@Test public void testAddBudgetPersonWithAppointments() throws Exception { assertTrue(budget.getBudgetPersons().isEmpty()); BudgetPerson testPerson = new BudgetPerson(); KcPerson person = kcPersonService.getKcPersonByPersonId(testAppointmentPersonId); testPerson.setPersonId(testAppointmentPersonId); budgetPersonService.addBudgetPerson(budget, testPerson); assertFalse(person.getExtendedAttributes().getPersonAppointments().isEmpty()); assertTrue( person.getExtendedAttributes().getPersonAppointments().size() == budget.getBudgetPersons().size()); }