1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.principal.service;
17
18 import java.sql.Date;
19 import java.util.ArrayList;
20 import java.util.List;
21
22 import junit.framework.Assert;
23
24 import org.junit.Test;
25 import org.kuali.hr.test.KPMETestCase;
26 import org.kuali.hr.time.principal.PrincipalHRAttributes;
27 import org.kuali.hr.time.service.base.TkServiceLocator;
28 import org.kuali.hr.time.util.TKUtils;
29
30 public class PrincipalHRAttributeServiceTest extends KPMETestCase {
31 @Test
32 public void testGetPrincipalHrAtributes() {
33 List<PrincipalHRAttributes> phraList = new ArrayList<PrincipalHRAttributes>();
34 Date fromEffDate = TKUtils.formatDateString("");
35 Date toEffDate = TKUtils.formatDateString("");
36 String leavePlan = "";
37
38
39 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", leavePlan, fromEffDate, toEffDate, "B", "Y");
40 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 3, phraList.size());
41
42 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", leavePlan, fromEffDate, toEffDate, "Y", "Y");
43 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 2, phraList.size());
44
45 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", leavePlan, fromEffDate, toEffDate, "N", "Y");
46 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 1, phraList.size());
47
48 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", leavePlan, fromEffDate, toEffDate, "N", "N");
49 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 1, phraList.size());
50 }
51 }