1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.pm.appointment;
17
18 import static org.junit.Assert.assertEquals;
19 import static org.junit.Assert.assertTrue;
20
21 import java.util.List;
22
23 import org.joda.time.LocalDate;
24 import org.junit.After;
25 import org.junit.Before;
26 import org.junit.Test;
27 import org.kuali.kpme.core.IntegrationTest;
28 import org.kuali.kpme.core.util.TKUtils;
29 import org.kuali.kpme.pm.PMIntegrationTestCase;
30 import org.kuali.kpme.pm.api.positionappointment.PositionAppointmentContract;
31 import org.kuali.kpme.pm.service.base.PmServiceLocator;
32
33 @IntegrationTest
34 public class PositionAppointmentServiceTest extends PMIntegrationTestCase {
35
36 private final String pmPositionAppointmentId = "123456789";
37 private final String positionAppointment = "testAppointment";
38 private final String groupKeyCode = "UGA-ATHENS";
39
40 @Before
41 public void setUp() throws Exception {
42 super.setUp();
43
44 }
45
46 @After
47 public void tearDown() throws Exception {
48 super.tearDown();
49 }
50
51 @Test
52 public void testGetPositionAppointmentById() throws Exception {
53
54 PositionAppointmentContract positionAppointment = PmServiceLocator.getPositionAppointmentService().getPositionAppointmentById(pmPositionAppointmentId);
55 assertEquals("testAppointment", positionAppointment.getPositionAppointment());
56 }
57
58 @Test
59 public void testGetPositionAppointmentList() throws Exception {
60
61 LocalDate todayDate = new LocalDate();
62 List<? extends PositionAppointmentContract> positionAppointments = PmServiceLocator.getPositionAppointmentService().getPositionAppointmentList(positionAppointment, "%", groupKeyCode,
63 TKUtils.formatDateString(""), TKUtils.formatDateString(""), "Y", "Y");
64 assertTrue(positionAppointments.size() == 1);
65 }
66
67 }