View Javadoc
1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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  }