View Javadoc
1   /*
2    * Copyright 2011 the original author or authors.
3    * 
4    * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.openehealth.ipf.commons.ihe.hl7v2.definitions.pdq.v25.message;
17  
18  import static org.junit.Assert.assertEquals;
19  import static org.junit.Assert.assertNotNull;
20  import static org.junit.Assert.assertTrue;
21  
22  import org.junit.Test;
23  
24  import ca.uhn.hl7v2.model.v25.group.RSP_K21_QUERY_RESPONSE;
25  
26  /**
27   * Tests the fix of issue #69 (Problem with RSP_K21.getRSP_K21_QUERY_RESPONSE())
28   * 
29   * @author Mitko Kolev
30   */
31  public class RSP_K21Test {
32  
33  	@Test
34  	public void testGetQUERY_RESPONSE(){
35  		//Fix of issue #69 (Problem with RSP_K21.getRSP_K21_QUERY_RESPONSE())
36  		RSP_K21 msg = new RSP_K21();
37  		RSP_K21_QUERY_RESPONSE response = msg.getQUERY_RESPONSE();
38  		assertNotNull (response);
39  		assertTrue(response instanceof RSP_K21_QUERY_RESPONSE);
40  	}
41  	
42  	@Test
43  	public void testGetRSP_K21_QUERY_RESPONSEReps(){
44  		RSP_K21 msg = new RSP_K21();
45  		assertEquals(0 , msg.getQUERY_RESPONSEReps());
46  	}
47  	
48  	@Test
49  	public void testGetRSP_K21_QUERY_RESPONSERepsWithParams() throws Exception {
50  		RSP_K21 msg = new RSP_K21();
51  		RSP_K21_QUERY_RESPONSE response = msg.getQUERY_RESPONSE(0);
52  		assertNotNull (response);
53  		response = msg.getQUERY_RESPONSE(1);
54  		assertNotNull (response);
55  	}
56  }