View Javadoc
1   /*
2    * Copyright 2016 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  
17  package org.openehealth.ipf.platform.camel.ihe.fhir.iti78;
18  
19  import org.hl7.fhir.dstu3.model.Bundle;
20  import org.junit.BeforeClass;
21  import org.junit.Test;
22  import org.openehealth.ipf.commons.audit.queue.AbstractMockedAuditMessageQueue;
23  
24  import javax.servlet.ServletException;
25  
26  import static org.junit.Assert.assertEquals;
27  
28  /**
29   *
30   */
31  public class TestIti78SecureSuccess extends AbstractTestIti78 {
32  
33      private static final String CONTEXT_DESCRIPTOR = "iti-78-secure.xml";
34  
35      @BeforeClass
36      public static void setUpClass() throws ServletException {
37          startServer(CONTEXT_DESCRIPTOR, true);
38      }
39  
40      @Test
41      public void testSendEndpointPdqmCriterion() {
42          Bundle result = getProducerTemplate().requestBody("direct:input", familyParameters(), Bundle.class);
43          // printAsXML(result);
44  
45          // Check ATNA Audit
46          AbstractMockedAuditMessageQueue sender = getAuditSender();
47          assertEquals(2, sender.getMessages().size());
48      }
49  
50      @Test
51      public void testSendEndpointPdqmString() {
52          Bundle result = getProducerTemplate().requestBody("direct:input", "Patient?family=Test", Bundle.class);
53          // printAsXML(result);
54  
55          // Check ATNA Audit
56          AbstractMockedAuditMessageQueue sender = getAuditSender();
57          assertEquals(2, sender.getMessages().size());
58      }
59  
60  
61  
62  
63  }