1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.location.web;
17
18 import org.junit.Assert;
19 import org.junit.Test;
20 import org.kuali.rice.kew.api.exception.WorkflowException;
21 import org.kuali.rice.krad.exception.ValidationException;
22 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
23 import org.kuali.rice.krad.test.document.bo.AccountManager;
24 import org.kuali.rice.location.api.country.Country;
25 import org.kuali.rice.location.impl.country.CountryBo;
26 import org.kuali.rice.test.BaselineTestCase;
27 import org.kuali.test.BaseMaintenanceDocumentTest;
28
29
30
31
32
33
34
35 public class CountryMaintenanceDocumentTest extends BaseMaintenanceDocumentTest {
36
37 @Override
38 protected Object getNewMaintainableObject() {
39 CountryBo country = new CountryBo();
40 country.setCode("KE");
41
42 return country;
43 }
44
45 @Override
46 protected String getDocumentTypeName() {
47 return "CountryMaintenanceDocument";
48 }
49
50 @Override
51 protected String getInitiatorPrincipalName() {
52 return "admin";
53 }
54
55 @Override
56 protected Object getOldMaintainableObject() {
57 return getNewMaintainableObject();
58 }
59
60 @Test(expected = ValidationException.class)
61
62
63
64 public void test_RouteNewDoc() throws WorkflowException {
65 setupNewAccountMaintDoc(getDocument());
66 KRADServiceLocatorWeb.getDocumentService().routeDocument(getDocument(), "submit", null);
67 Assert.assertTrue(getDocument().getDocumentHeader().getWorkflowDocument().isEnroute());
68 }
69 }