Exemplo n.º 1
0
 @Test
 public void testIsAppointmentApplicableToBudget() {
   PersonAppointment appointment = new PersonAppointment();
   appointment.setStartDate(createDate(2000, 1, 1));
   assertTrue(budgetPersonService.isAppointmentApplicableToBudget(budget, appointment));
   appointment.setEndDate(createDate(2009, 1, 1));
   assertFalse(budgetPersonService.isAppointmentApplicableToBudget(budget, appointment));
   appointment.setEndDate(createDate(2020, 1, 1));
   assertTrue(budgetPersonService.isAppointmentApplicableToBudget(budget, appointment));
   appointment.setStartDate(createDate(2019, 1, 1));
   assertFalse(budgetPersonService.isAppointmentApplicableToBudget(budget, appointment));
 }
Exemplo n.º 2
0
 @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);
 }
Exemplo n.º 3
0
 @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());
 }