1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.role;
17
18 import org.junit.Assert;
19 import org.junit.Before;
20 import org.junit.Test;
21 import org.kuali.kpme.core.CoreUnitTestCase;
22 import org.kuali.kpme.core.IntegrationTest;
23 import org.kuali.kpme.core.api.namespace.KPMENamespace;
24 import org.kuali.kpme.core.service.HrServiceLocator;
25 import org.kuali.rice.kim.api.role.RoleService;
26
27 @IntegrationTest
28 public class KpmeRoleTest extends CoreUnitTestCase {
29
30 private RoleService roleService;
31
32 @Before
33 public void setUp() throws Exception {
34 super.setUp();
35 roleService = HrServiceLocator.getService("kimRoleService");
36 }
37
38 @Test
39 public void testGetPositionRoles() {
40
41
42 String roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_PM.getNamespaceCode(), KPMERole.POSITION_SYSTEM_ADMINISTRATOR.getRoleName());
43 Assert.assertNotNull(roleId);
44 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_PM.getNamespaceCode(), KPMERole.POSITION_SYSTEM_VIEW_ONLY.getRoleName());
45 Assert.assertNotNull(roleId);
46
47
48 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.KOHR_INSTITUTION_ADMINISTRATOR.getRoleName());
49 Assert.assertNotNull(roleId);
50 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.KOHR_ACADEMIC_HR_ADMINISTRATOR.getRoleName());
51 Assert.assertNotNull(roleId);
52 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.KOHR_INSTITUTION_VIEW_ONLY.getRoleName());
53 Assert.assertNotNull(roleId);
54 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.KOHR_LOCATION_ADMINISTRATOR.getRoleName());
55 Assert.assertNotNull(roleId);
56 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.KOHR_LOCATION_VIEW_ONLY.getRoleName());
57 Assert.assertNotNull(roleId);
58 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.KOHR_ORG_ADMINISTRATOR.getRoleName());
59 Assert.assertNotNull(roleId);
60 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.KOHR_ORG_VIEW_ONLY.getRoleName());
61 Assert.assertNotNull(roleId);
62 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.HR_DEPARTMENT_ADMINISTRATOR.getRoleName());
63 Assert.assertNotNull(roleId);
64 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.HR_DEPARTMENT_VIEW_ONLY.getRoleName());
65 Assert.assertNotNull(roleId);
66 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.HR_INSTITUTION_APPROVER.getRoleName());
67 Assert.assertNotNull(roleId);
68 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.ACADEMIC_HR_INSTITUTION_APPROVER.getRoleName());
69 Assert.assertNotNull(roleId);
70 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.BUDGET_APPROVER.getRoleName());
71 Assert.assertNotNull(roleId);
72 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.PAYROLL_APPROVER.getRoleName());
73 Assert.assertNotNull(roleId);
74 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.HR_LOCATION_APPROVER.getRoleName());
75 Assert.assertNotNull(roleId);
76 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.ACADEMIC_HR_LOCATION_APPROVER.getRoleName());
77 Assert.assertNotNull(roleId);
78 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.FISCAL_LOCATION_APPROVER.getRoleName());
79 Assert.assertNotNull(roleId);
80 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.HR_ORG_APPROVER.getRoleName());
81 Assert.assertNotNull(roleId);
82 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.FISCAL_ORG_APPROVER.getRoleName());
83 Assert.assertNotNull(roleId);
84 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.DEPARTMENT_APPROVER.getRoleName());
85 Assert.assertNotNull(roleId);
86 roleId = roleService.getRoleIdByNamespaceCodeAndName(KPMENamespace.KPME_HR.getNamespaceCode(), KPMERole.FISCAL_DEPARTMENT_APPROVER.getRoleName());
87 Assert.assertNotNull(roleId);
88 }
89
90 }