1 package org.kuali.ole.deliver.circulation;
2
3 import com.ibm.icu.impl.Assert;
4 import org.junit.Before;
5 import org.junit.Test;
6 import org.kuali.ole.deliver.bo.OleCirculationDeskDetail;
7 import org.kuali.ole.deliver.service.OleCirculationDeskDetailServiceImpl;
8 import static junit.framework.Assert.assertFalse;
9 import java.util.ArrayList;
10 import java.util.List;
11
12
13
14
15 public class OleCirculationDeskMapping_UT {
16
17
18 private OleCirculationDeskDetailServiceImpl oleCirculationDeskDetailService;
19
20
21
22 @Test
23 public void clearAllCirulationMappingTest() throws Exception{
24 OleCirculationDeskDetail oleCirculationDeskDetailOne = new OleCirculationDeskDetail();
25 oleCirculationDeskDetailOne.setDefaultLocation(true);
26 oleCirculationDeskDetailOne.setCirculationDeskDetailId("1");
27 oleCirculationDeskDetailOne.setAllowedLocation(false);
28 oleCirculationDeskDetailOne.setOperatorId("eric");
29
30 OleCirculationDeskDetail oleCirculationDeskDetailtwo = new OleCirculationDeskDetail();
31 oleCirculationDeskDetailtwo.setDefaultLocation(false);
32 oleCirculationDeskDetailtwo.setCirculationDeskDetailId("2");
33 oleCirculationDeskDetailtwo.setAllowedLocation(true);
34 oleCirculationDeskDetailtwo.setOperatorId("eric");
35
36 ArrayList<OleCirculationDeskDetail> oleCirculationDeskDetails = new ArrayList<OleCirculationDeskDetail>();
37 oleCirculationDeskDetails.add(oleCirculationDeskDetailOne);
38 oleCirculationDeskDetails.add(oleCirculationDeskDetailtwo);
39 oleCirculationDeskDetailService = new OleCirculationDeskDetailServiceImpl();
40 List clearList = oleCirculationDeskDetailService.clearAllCirulationMapping(oleCirculationDeskDetails);
41
42 assertFalse(((OleCirculationDeskDetail) clearList.get(0)).isDefaultLocation());
43 assertFalse(((OleCirculationDeskDetail) clearList.get(1)).isAllowedLocation());
44
45 }
46 }