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.api.checklist.EdoChecklistSection;
29  import org.kuali.kpme.edo.service.EdoServiceLocator;
30  
31  @IntegrationTest
32  public class EdoChecklistSectionServiceTest extends EdoUnitTestBase {
33  
34  	private final String edoChecklistSectionId = "1000";
35  	private final String edoChecklistId = "1000";
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 testGetEdoChecklistSectionById() throws Exception {
50  
51  		EdoChecklistSection edoChecklistSection = EdoServiceLocator.getChecklistSectionService().getChecklistSectionById(edoChecklistSectionId);
52  		assertEquals("testEdoChecklistSection1", edoChecklistSection.getChecklistSectionName());
53  		assertEquals("returned the correct number of results for items", 3, edoChecklistSection.getChecklistItems().size());
54  	}
55  	
56  	@Test
57  	public void testGetChecklistItemsBySectionId() throws Exception {
58  		
59  		List<EdoChecklistSection> sections = EdoServiceLocator.getChecklistSectionService().getChecklistSectionsByChecklistId(edoChecklistId);
60  		assertEquals("returned the correct number of resultss", 2, sections.size());
61  	}
62  }