1 package org.kuali.ole.deliver.circulationdesk.bo;
2
3 import org.junit.Before;
4 import org.junit.Test;
5 import org.junit.runner.RunWith;
6 import org.kuali.ole.deliver.circulationdesk.bo.OleCirculationDesk;
7 import org.kuali.ole.deliver.circulationdesk.service.OleCirculationDeskDetailServiceImpl;
8 import org.kuali.rice.krad.service.BusinessObjectService;
9 import org.kuali.rice.krad.service.KRADServiceLocator;
10 import org.springframework.test.context.ContextConfiguration;
11 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
12 import org.springframework.test.context.transaction.TransactionConfiguration;
13 import org.springframework.transaction.annotation.Transactional;
14 import static junit.framework.Assert.assertEquals;
15
16
17
18
19
20
21
22
23
24 @ContextConfiguration(locations = {"classpath:/SpringBeans.xml"})
25 @RunWith(value = SpringJUnit4ClassRunner.class)
26 @TransactionConfiguration(defaultRollback = true)
27 public class OleCirculationDesk_UT {
28
29 private BusinessObjectService boService ;
30 @Before
31 public void setUp() throws Exception {
32 boService = KRADServiceLocator.getBusinessObjectService();
33
34 }
35
36 @Test
37 @Transactional
38 public void testSave() {
39 OleCirculationDesk oleCirculationDesk = new OleCirculationDesk();
40 oleCirculationDesk.setCirculationDeskCode("code");
41 oleCirculationDesk.setCirculationDeskPublicName("publicName");
42 oleCirculationDesk.setCirculationDeskStaffName("staffName");
43 oleCirculationDesk.setActive(true);
44 oleCirculationDesk.setLocationId("1");
45 boService.save(oleCirculationDesk);
46 OleCirculationDesk oleCirculationDeskService = boService.findBySinglePrimaryKey(OleCirculationDesk.class,oleCirculationDesk.getCirculationDeskId());
47 assertEquals("code",oleCirculationDeskService.getCirculationDeskCode());
48 assertEquals("publicName",oleCirculationDeskService.getCirculationDeskPublicName());
49 }
50
51 @Test
52 @Transactional
53 public void testSearch(){
54 OleCirculationDesk oleCirculationDesk = new OleCirculationDesk();
55 oleCirculationDesk.setCirculationDeskCode("code");
56 oleCirculationDesk.setCirculationDeskPublicName("publicName");
57 oleCirculationDesk.setCirculationDeskStaffName("staffName");
58 oleCirculationDesk.setActive(true);
59 oleCirculationDesk.setLocationId("1");
60 boService.save(oleCirculationDesk);
61 OleCirculationDesk oleCirculationDeskService = boService.findBySinglePrimaryKey(OleCirculationDesk.class,oleCirculationDesk.getCirculationDeskId());
62 assertEquals("code",oleCirculationDeskService.getCirculationDeskCode());
63 assertEquals("publicName",oleCirculationDeskService.getCirculationDeskPublicName());
64 }
65
66 }
67
68
69