1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.service;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 import org.junit.Test;
22 import org.kuali.rice.kns.test.document.bo.Account;
23 import org.kuali.rice.kns.test.document.bo.AccountManager;
24 import org.kuali.test.KNSTestCase;
25 import org.kuali.test.KNSWithTestSpringContext;
26
27
28
29
30
31
32
33
34 @KNSWithTestSpringContext
35 public class BusinessObjectServiceTest extends KNSTestCase {
36
37 public BusinessObjectServiceTest() {}
38
39
40
41
42
43
44 @Test
45 public void testSave() throws Exception {
46 BusinessObjectService businessObjectService = KNSServiceLocator.getBusinessObjectService();
47
48 AccountManager am = new AccountManager();
49 am.setUserName("bhutchin");
50 List<Account> accounts = new ArrayList<Account>();
51 Account account1 = new Account();
52 account1.setNumber("1");
53 account1.setName("account 1");
54 account1.setAccountManager(am);
55 accounts.add(account1);
56
57 Account account2 = new Account();
58 account2.setNumber("2");
59 account2.setName("account 2");
60 account2.setAccountManager(am);
61
62 accounts.add(account2);
63 am.setAccounts(accounts);
64
65 businessObjectService.save(am);
66 }
67
68 }