1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.edo.checklist;
17
18 import static org.junit.Assert.assertEquals;
19
20 import java.util.List;
21
22 import org.junit.After;
23 import org.junit.Before;
24 import org.junit.Test;
25 import org.kuali.kpme.core.IntegrationTest;
26 import org.kuali.kpme.edo.EdoUnitTestBase;
27 import org.kuali.kpme.edo.api.checklist.EdoChecklistItem;
28 import org.kuali.kpme.edo.service.EdoServiceLocator;
29
30 @IntegrationTest
31 public class EdoChecklistItemServiceTest extends EdoUnitTestBase {
32
33 private final String edoChecklistItemId = "1000";
34 private final String edoCheckListSectionId = "2000";
35 private final String edoDossierId = "2000";
36
37 @Before
38 public void setUp() throws Exception {
39 super.setUp();
40
41 }
42
43 @After
44 public void tearDown() throws Exception {
45 super.tearDown();
46 }
47
48 @Test
49 public void testGetEdoChecklistItemById() throws Exception {
50
51 EdoChecklistItem edoChecklistItem = EdoServiceLocator.getChecklistItemService().getChecklistItemById(edoChecklistItemId);
52 assertEquals("testEdoChecklistItem1", edoChecklistItem.getChecklistItemName());
53 }
54
55 @Test
56 public void testGetChecklistItemsBySectionId() throws Exception {
57
58 List<EdoChecklistItem> items = EdoServiceLocator.getChecklistItemService().getChecklistItemsBySectionId(edoCheckListSectionId);
59 assertEquals("returned the correct number of results", 2, items.size());
60 }
61
62 @Test
63 public void testGetChecklistItems() throws Exception {
64
65 List<EdoChecklistItem> items = EdoServiceLocator.getChecklistItemService().getChecklistItems("IU-IN", "DEFAULT", "ENGINEERING");
66 assertEquals("returned the correct number of results", 4, items.size());
67 }
68
69 @Test
70 public void testGetChecklistItemByDossierId() throws Exception {
71
72 EdoChecklistItem item = EdoServiceLocator.getChecklistItemService().getChecklistItemByDossierId(edoDossierId, "testEdoChecklistItem4");
73 assertEquals("Testing Immutable EdoChecklistItem4", item.getItemDescription());
74 }
75 }