View Javadoc
1   /*
2    * Copyright 2018 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.core.atna;
17  
18  import org.junit.Before;
19  import org.openhealthtools.ihe.atna.auditor.context.AuditorModuleContext;
20  import org.openhealthtools.ihe.atna.auditor.models.rfc3881.CodedValueType;
21  
22  import java.util.ArrayList;
23  import java.util.List;
24  
25  /**
26   * @author Dmytro Rud
27   * @deprecated
28   */
29  class OhtAuditorTestBase {
30  
31      protected static final String REPLY_TO_URI = "http://141.44.162.126:8090/services/iti55-response";
32      protected static final String USER_ID = "user-id";
33      protected static final String USER_NAME = "alias<user@issuer>";
34      protected static final String QUERY_PAYLOAD = "<query><coffee /></query>";
35      protected static final String SERVER_URI = "http://www.icw.int/pxs/iti55-service";
36      protected static final String QUERY_ID = "queryIdExtension@queryIdRoot";
37      protected static final String MESSAGE_ID = "messageIdExtension@messageIdRoot";
38      protected static final String HOME_COMMUNITY_ID = "urn:oid:3.14.15.926";
39      protected static final String CLIENT_IP_ADDRESS = "141.44.162.126";
40  
41  
42      protected static final String SENDING_FACILITY = "SF";
43      protected static final String SENDING_APPLICATION = "SA";
44      protected static final String RECEIVING_FACILITY = "RF";
45      protected static final String RECEIVING_APPLICATION = "RA";
46  
47      protected static final String[] PATIENT_IDS = new String[]{"1234^^^&1.2.3.4.5.6&ISO", "durak^^^&6.7.8.9.10&KRYSO"};
48  
49      protected static final List<CodedValueType> PURPOSES_OF_USE;
50  
51      static {
52          PURPOSES_OF_USE = new ArrayList<>();
53          CodedValueType cvt = new CodedValueType();
54  
55          cvt.setCode("12");
56          cvt.setCodeSystemName("1.0.14265.1");
57          cvt.setOriginalText("Law Enforcement");
58          PURPOSES_OF_USE.add(cvt);
59  
60          cvt.setCode("13");
61          cvt.setCodeSystemName("1.0.14265.1");
62          cvt.setOriginalText("Something Else");
63          PURPOSES_OF_USE.add(cvt);
64      }
65  
66      protected static final List<CodedValueType> USER_ROLES;
67  
68      static {
69          USER_ROLES = new ArrayList<>();
70          CodedValueType cvt = new CodedValueType();
71  
72          cvt.setCode("ABC");
73          cvt.setCodeSystemName("1.2.3.4.5");
74          cvt.setOriginalText("Role_ABC");
75          PURPOSES_OF_USE.add(cvt);
76  
77          cvt.setCode("DEF");
78          cvt.setCodeSystemName("1.2.3.4.5.6");
79          cvt.setOriginalText("Role_DEF");
80          PURPOSES_OF_USE.add(cvt);
81      }
82  
83      protected MockedSender sender;
84  
85      @Before
86      public void setUp() {
87          sender = new MockedSender();
88          AuditorModuleContext.getContext().setSender(sender);
89          AuditorModuleContext.getContext().getConfig().setAuditRepositoryHost("localhost");
90          AuditorModuleContext.getContext().getConfig().setAuditRepositoryPort(514);
91      }
92  
93  
94  }