1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.location.bo;
17
18 import org.junit.Test;
19 import org.junit.runner.RunWith;
20 import org.kuali.ole.OleBaseTestCase;
21 import org.kuali.ole.location.bo.OleLocationLevel;
22 import org.kuali.rice.krad.service.BusinessObjectService;
23 import org.kuali.rice.krad.service.KRADServiceLocator;
24 import org.springframework.test.context.ContextConfiguration;
25 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
26 import org.springframework.test.context.transaction.TransactionConfiguration;
27 import org.springframework.transaction.annotation.Transactional;
28
29 import static junit.framework.Assert.assertEquals;
30
31
32 public class OleLocationLevel_UT extends OleBaseTestCase {
33
34
35 private BusinessObjectService boService;
36
37 @Test
38 @Transactional
39 public void testSave() {
40 OleLocationLevel oleLocationLevel = new OleLocationLevel();
41 oleLocationLevel.setLevelId("5000");
42 oleLocationLevel.setLevelCode("mockCode");
43 oleLocationLevel.setLevelName("mockName");
44 boService = KRADServiceLocator.getBusinessObjectService();
45 boService.save(oleLocationLevel);
46 OleLocationLevel oleLocationLevelService = boService.findBySinglePrimaryKey(OleLocationLevel.class,oleLocationLevel.getLevelId());
47 assertEquals("mockCode",oleLocationLevelService.getLevelCode());
48 assertEquals("mockName",oleLocationLevelService.getLevelName());
49 }
50
51 @Test
52 @Transactional
53 public void testSearch(){
54 OleLocationLevel oleLocationLevel = new OleLocationLevel();
55 oleLocationLevel.setLevelId("5000");
56 oleLocationLevel.setLevelCode("mockCode");
57 oleLocationLevel.setLevelName("mockName");
58 boService = KRADServiceLocator.getBusinessObjectService();
59 boService.save(oleLocationLevel);
60 OleLocationLevel oleLocationLevelService = boService.findBySinglePrimaryKey(OleLocationLevel.class,oleLocationLevel.getLevelId());
61 assertEquals("mockCode",oleLocationLevelService.getLevelCode());
62 assertEquals("mockName",oleLocationLevelService.getLevelName());
63 }
64
65 }