1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.tutorials.iheclient;
17
18 import java.io.InputStream;
19 import java.nio.charset.Charset;
20
21 import org.apache.commons.io.IOUtils;
22 import org.junit.Ignore;
23 import org.junit.Test;
24 import org.junit.runner.RunWith;
25 import org.springframework.beans.factory.annotation.Autowired;
26 import org.springframework.context.ApplicationContext;
27 import org.springframework.test.context.ContextConfiguration;
28 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
29
30 import static org.junit.Assert.assertNotNull;
31
32 @RunWith(SpringJUnit4ClassRunner.class)
33 @ContextConfiguration(locations = "classpath:context.xml")
34 public class IHEWebServiceClientTest {
35
36 @Autowired
37 private IHEWebServiceClient iheClient;
38
39 @Autowired
40 private ApplicationContext applicationContext;
41
42 @Test
43 public void testSmoke() throws Exception {
44 assertNotNull(iheClient.getCamelContext());
45 }
46
47 @Ignore
48 public void testIti47() throws Exception {
49 InputStream in = getClass().getResourceAsStream("/example-messages/PDQv3.xml");
50 String request = IOUtils.toString(in, Charset.defaultCharset());
51 String result = iheClient.iti47PatientDemographicsQuery(request, "localhost", 8080, "pix-xref-mgr/ws/iti47Service?secure=true", false);
52 System.out.println(result);
53 }
54
55 }