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  
21  import org.junit.Test;
22  import org.openehealth.ipf.commons.ihe.hl7v2.definitions.pdq.v25.group.RSP_ZV2_QUERY_RESPONSE;
23  
24  /**
25   * Tests the fix of issue #69 (Problem with RSP_K21.getRSP_K21_QUERY_RESPONSE()) with the  
26   * structure RSP_ZV2
27   * 
28   * @author Mitko Kolev
29   */
30  public class RSP_ZV2Test {
31  
32  	@Test
33  	public void testGetQUERY_RESPONSE(){
34  		//Fix of issue #69 (Problem with RSP_K21.getRSP_K21_QUERY_RESPONSE())
35  		RSP_ZV2 msg = new RSP_ZV2();
36  		RSP_ZV2_QUERY_RESPONSE response = msg.getQUERY_RESPONSE();
37  		assertNotNull (response);
38  	}
39  	
40  	@Test
41  	public void testGetRSP_ZV2_QUERY_RESPONSEReps(){
42  		RSP_ZV2 msg = new RSP_ZV2();
43  		assertEquals(0 , msg.getQUERY_RESPONSEReps());
44  	}
45  	
46  	@Test
47  	public void testGetRSP_ZV2_QUERY_RESPONSERepsWithParams() throws Exception {
48  		RSP_ZV2 msg = new RSP_ZV2();
49  		RSP_ZV2_QUERY_RESPONSE response = msg.getQUERY_RESPONSE(0);
50  		assertNotNull (response);
51  		response = msg.getQUERY_RESPONSE(1);
52  		assertNotNull (response);
53  
54  	}
55  }