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
37
38 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", fromEffDate, toEffDate, "B", "Y");
39 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 3, phraList.size());
40
41 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", fromEffDate, toEffDate, "Y", "Y");
42 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 2, phraList.size());
43
44 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", fromEffDate, toEffDate, "N", "Y");
45 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 1, phraList.size());
46
47 phraList = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalHrAtributes("testUser", fromEffDate, toEffDate, "N", "N");
48 Assert.assertEquals("Incorrect number of PrincipalHRAttributes", 1, phraList.size());
49 }
50 }