| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package org.kuali.rice.kew.routing; |
| 18 |
|
|
| 19 |
|
import org.junit.Test; |
| 20 |
|
import org.kuali.rice.kew.dto.ActionRequestDTO; |
| 21 |
|
import org.kuali.rice.kew.service.WorkflowDocument; |
| 22 |
|
import org.kuali.rice.kew.test.KEWTestCase; |
| 23 |
|
import org.kuali.rice.kew.test.TestUtilities; |
| 24 |
|
import org.kuali.rice.kim.service.KIMServiceLocator; |
| 25 |
|
|
| 26 |
|
import static org.junit.Assert.assertTrue; |
| 27 |
|
|
|
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 3 |
Complexity Density: 0.18 |
|
| 28 |
|
public class RoutingWithEmptyWorkGroupTest extends KEWTestCase { |
| 29 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 30 |
0
|
protected void loadTestData() throws Exception {... |
| 31 |
0
|
loadXmlFile("RoutingWithEmptyGroupConfig.xml"); |
| 32 |
|
} |
| 33 |
|
|
|
|
|
| 0% |
Uncovered Elements: 18 (18) |
Complexity: 2 |
Complexity Density: 0.12 |
4
-
|
|
| 34 |
0
|
@Test public void testRoutingToEmptyWorkgroup() throws Exception {... |
| 35 |
|
|
| 36 |
0
|
String user1PrincipalId = getPrincipalIdForName("user1"); |
| 37 |
0
|
String user2PrincipalId = getPrincipalIdForName("user2"); |
| 38 |
0
|
String user3PrincipalId = getPrincipalIdForName("user3"); |
| 39 |
|
|
| 40 |
0
|
WorkflowDocument doc = new WorkflowDocument(user1PrincipalId, "EmptyWorkgroupDocType"); |
| 41 |
|
|
| 42 |
0
|
doc = new WorkflowDocument("user1", doc.getRouteHeaderId()); |
| 43 |
|
|
| 44 |
0
|
doc.routeDocument(""); |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
|
| 50 |
0
|
doc = new WorkflowDocument(user2PrincipalId, doc.getRouteHeaderId()); |
| 51 |
|
|
| 52 |
0
|
assertTrue("Document should be enroute", doc.stateIsEnroute()); |
| 53 |
0
|
TestUtilities.assertAtNode(doc, "Node3"); |
| 54 |
|
|
| 55 |
0
|
TestUtilities.assertInActionList(user2PrincipalId, doc.getRouteHeaderId()); |
| 56 |
|
|
| 57 |
|
|
| 58 |
0
|
ActionRequestDTO[] actionRequests = doc.getActionRequests(); |
| 59 |
0
|
for (ActionRequestDTO actionRequest : actionRequests) { |
| 60 |
0
|
if ("Node2".equals(actionRequest.getNodeName())) { |
| 61 |
0
|
assertTrue("action request should be for a group", actionRequest.isGroupRequest()); |
| 62 |
0
|
assertTrue("action request should be marked as \"done\"", actionRequest.isDone()); |
| 63 |
0
|
assertTrue("Group should have no members.", KIMServiceLocator.getIdentityManagementService().getGroupMemberPrincipalIds(actionRequest.getGroupId()).isEmpty()); |
| 64 |
|
} |
| 65 |
|
} |
| 66 |
|
} |
| 67 |
|
} |