1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package mocks;
17
18 import java.util.List;
19
20 import org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent;
21 import org.kuali.rice.kew.framework.postprocessor.AfterProcessEvent;
22 import org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent;
23 import org.kuali.rice.kew.framework.postprocessor.DeleteEvent;
24 import org.kuali.rice.kew.framework.postprocessor.DocumentLockingEvent;
25 import org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange;
26 import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange;
27 import org.kuali.rice.kew.framework.postprocessor.PostProcessor;
28 import org.kuali.rice.kew.framework.postprocessor.ProcessDocReport;
29
30 public class MockPostProcessor implements PostProcessor {
31
32 private boolean processDocReportResult = true;
33 private boolean actionTakenResult = true;
34 private boolean processMethodsDocReportResult = true;
35 private List<String> documentIdsToLockResult = null;
36
37 public MockPostProcessor() {
38 this(true);
39 }
40
41 public MockPostProcessor(boolean processDocReportResult) {
42 this(processDocReportResult, true);
43 }
44
45 public MockPostProcessor(boolean processDocReportResult, boolean actionTakenResult) {
46 this(processDocReportResult, actionTakenResult, true);
47 }
48
49 public MockPostProcessor(boolean processDocReportResult, boolean actionTakenResult, boolean processMethodsDocReportResult) {
50 this(processDocReportResult, actionTakenResult, processMethodsDocReportResult, null);
51 }
52
53 public MockPostProcessor(boolean processDocReportResult, boolean actionTakenResult, boolean processMethodsDocReportResult, List<String> documentIdsToLockResult) {
54 this.processDocReportResult = processDocReportResult;
55 this.actionTakenResult = actionTakenResult;
56 this.processMethodsDocReportResult = processMethodsDocReportResult;
57 this.documentIdsToLockResult = documentIdsToLockResult;
58 }
59
60 public ProcessDocReport doDeleteRouteHeader(DeleteEvent event) throws Exception {
61 return new ProcessDocReport(processDocReportResult, "testing");
62 }
63 public ProcessDocReport doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) throws Exception {
64 return new ProcessDocReport(processDocReportResult, "testing");
65 }
66 public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {
67 return new ProcessDocReport(processDocReportResult, "testing");
68 }
69
70 public ProcessDocReport doActionTaken(ActionTakenEvent event) throws Exception {
71 return new ProcessDocReport(actionTakenResult, "testing");
72 }
73
74 public ProcessDocReport beforeProcess(BeforeProcessEvent event) throws Exception {
75 return new ProcessDocReport(processMethodsDocReportResult, "testing");
76 }
77
78 public ProcessDocReport afterProcess(AfterProcessEvent event) throws Exception {
79 return new ProcessDocReport(processMethodsDocReportResult, "testing");
80 }
81
82 public List<String> getDocumentIdsToLock(DocumentLockingEvent lockingEvent) throws Exception {
83 return documentIdsToLockResult;
84 }
85
86 public void setProcessDocReportResult(boolean processDocReportResult) {
87 this.processDocReportResult = processDocReportResult;
88 }
89
90 public void setActionTakenResult(boolean actionTakenResult) {
91 this.actionTakenResult = actionTakenResult;
92 }
93
94 public void setProcessMethodsDocReportResult(boolean processMethodsDocReportResult) {
95 this.processMethodsDocReportResult = processMethodsDocReportResult;
96 }
97
98 public void setDocumentIdsToLockResult(List<String> documentIdsToLockResult) {
99 this.documentIdsToLockResult = documentIdsToLockResult;
100 }
101
102 }