View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.document;
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.service.KRADServiceLocatorWeb;
22  import org.kuali.rice.krad.test.document.bo.AccountManager;
23  import org.kuali.test.BaseMaintenanceDocumentTest;
24  
25  /**
26   * This class...
27   * 
28   * 
29   */
30  public class AccountManagerMaintenanceDocumentTest extends BaseMaintenanceDocumentTest {
31  
32      @Override
33      protected Object getNewMaintainableObject()  {
34          AccountManager am = new AccountManager();
35          am.setAmId(new Long(1));
36          am.setUserName("userName");
37          return am;
38      }
39  
40      @Override
41      protected String getDocumentTypeName() {
42          return "AccountManagerMaintenanceDocument";
43      }
44  
45      @Override
46      protected String getInitiatorPrincipalName() {
47          return "quickstart";
48      }
49  
50      @Override
51      protected Object getOldMaintainableObject() {
52          return getNewMaintainableObject();
53      }
54  
55       @Test
56      /**
57       * test submitting
58       */
59      public void testRouteNewDoc() throws WorkflowException {
60          setupNewAccountMaintDoc(getDocument());
61          KRADServiceLocatorWeb.getDocumentService().routeDocument(getDocument(), "submit", null);
62          Assert.assertTrue(getDocument().getDocumentHeader().getWorkflowDocument().isFinal());
63      }
64  }