01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.chart.bo;
17:
18: import static org.kuali.test.fixtures.UserNameFixture.KHUNTLEY;
19:
20: import java.util.ArrayList;
21: import java.util.List;
22:
23: import org.kuali.core.service.BusinessObjectService;
24: import org.kuali.core.service.DocumentService;
25: import org.kuali.kfs.context.KualiTestBase;
26: import org.kuali.kfs.context.SpringContext;
27: import org.kuali.kfs.document.AccountingDocument;
28: import org.kuali.module.financial.document.TransferOfFundsDocument;
29: import org.kuali.test.ConfigureContext;
30: import org.kuali.test.DocumentTestUtils;
31:
32: @ConfigureContext(session=KHUNTLEY,shouldCommitTransactions=true)
33: public class ObjectCodeGlobalDetailTest extends KualiTestBase {
34: private AccountingDocument document;
35:
36: @Override
37: protected void setUp() throws Exception {
38: super .setUp();
39: document = DocumentTestUtils.createDocument(SpringContext
40: .getBean(DocumentService.class),
41: TransferOfFundsDocument.class);
42: SpringContext.getBean(DocumentService.class).saveDocument(
43: document);
44: }
45:
46: public void testSave() {
47:
48: ObjectCodeGlobalDetail detail = new ObjectCodeGlobalDetail();
49: ObjectCodeGlobal doc = new ObjectCodeGlobal();
50:
51: doc.setDocumentNumber(document.getDocumentNumber());
52:
53: detail.setDocumentNumber(document.getDocumentNumber());
54: detail.setUniversityFiscalYear(document.getPostingYear());
55: detail.setChartOfAccountsCode("BL");
56:
57: List<ObjectCodeGlobalDetail> list = new ArrayList<ObjectCodeGlobalDetail>();
58: list.add(detail);
59: doc.setObjectCodeGlobalDetails(list);
60:
61: SpringContext.getBean(BusinessObjectService.class).save(doc);
62: }
63:
64: }
|