1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.actions;
17
18 import org.junit.Test;
19 import org.kuali.rice.kew.actionitem.ActionItem;
20 import org.kuali.rice.kew.actions.BlanketApproveTest.NotifySetup;
21 import org.kuali.rice.kew.actiontaken.ActionTakenValue;
22 import org.kuali.rice.kew.api.WorkflowDocument;
23 import org.kuali.rice.kew.api.WorkflowDocumentFactory;
24 import org.kuali.rice.kew.service.KEWServiceLocator;
25 import org.kuali.rice.kew.test.KEWTestCase;
26
27 import java.util.Collection;
28 import java.util.List;
29
30 import static org.junit.Assert.*;
31
32 public class LogDocumentActionTest extends KEWTestCase {
33
34 protected void loadTestData() throws Exception {
35 loadXmlFile("ActionsConfig.xml");
36 }
37
38 @Test public void testLogAnnotation() throws Exception {
39 WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("ewestfal"), NotifySetup.DOCUMENT_TYPE_NAME);
40 Collection actionsTaken = KEWServiceLocator.getActionTakenService().getActionsTaken(document.getDocumentId());
41 assertEquals(0, actionsTaken.size());
42
43 document.logAnnotation("going to route doc");
44 actionsTaken = KEWServiceLocator.getActionTakenService().getActionsTaken(document.getDocumentId());
45 assertEquals(1, actionsTaken.size());
46 ActionTakenValue actionTaken = (ActionTakenValue) actionsTaken.iterator().next();
47 assertTrue(actionTaken.getCurrentIndicator());
48 }
49 }