1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.workflow.service;
17
18
19 import org.junit.Assert;
20
21 import org.junit.Test;
22 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
23 import org.kuali.rice.kew.api.KewApiServiceLocator;
24 import org.kuali.rice.krad.test.KRADTestCase;
25
26
27
28
29
30
31
32 @Deprecated
33 public class WorkflowInfoServiceTest extends KRADTestCase {
34
35 @Test public void testRouteHeaderExists_NullId() throws IllegalArgumentException {
36 boolean errorThrown = false;
37 try {
38 KewApiServiceLocator.getWorkflowDocumentService().doesDocumentExist(null);
39 } catch (RiceIllegalArgumentException e) {
40 errorThrown = true;
41 }
42 Assert.assertTrue("An error should have been thrown.", errorThrown);
43 }
44
45 @Test public void testRouteHeaderExists_NegativeId() {
46 boolean errorThrown = false;
47 boolean result = true;
48 try {
49 result = KewApiServiceLocator.getWorkflowDocumentService().doesDocumentExist("-10");
50 } catch (Exception e) {
51 errorThrown = true;
52 }
53 Assert.assertFalse("An error should not have been thrown.", errorThrown);
54 Assert.assertFalse("The routeHeader should never exist for a negative documentId.", result);
55 }
56
57 @Test public void testRouteHeaderExists_KnownBadZeroId() {
58 boolean errorThrown = false;
59 boolean result = true;
60 try {
61 result = KewApiServiceLocator.getWorkflowDocumentService().doesDocumentExist("0");
62 }
63 catch (Exception e) {
64 errorThrown = true;
65 }
66 Assert.assertFalse("An error should not have been thrown.", errorThrown);
67 Assert.assertFalse("The routeHeader should never exist for a documentId of 0.", result);
68 }
69
70 @Test public void testRouteHeaderExists_KnownGood() {
71
72
73 Assert.assertTrue("This has been checked with a known-good id in the DB at this time.", true);
74 }
75
76 }