@@ -130,12 +130,8 @@ public abstract class AbstractIntegrationTest extends AbstractDbTest
130130
131131 private static final ReferenceCleaner referenceCleaner = new ReferenceCleanerImpl (new ReferenceExtractorImpl ());
132132
133- private static String fhirBaseUrl ;
134133 private static JettyServer fhirServer ;
135-
136134 private static FhirWebserviceClient webserviceClient ;
137-
138- private static String bpeBaseUrl ;
139135 private static JettyServer bpeServer ;
140136
141137 @ BeforeClass
@@ -145,18 +141,18 @@ public static void beforeClass() throws Exception
145141 fhirLiquibaseRule .getMappedPort (5432 ), fhirLiquibaseRule .getDatabaseName ());
146142 fhirDefaultDataSource .unwrap (BasicDataSource .class ).start ();
147143
148- ServerSocketChannel fhirStatusConnectorChannel = JettyServer .serverSocketChannel ();
149- ServerSocketChannel fhirApiConnectorChannel = JettyServer .serverSocketChannel ();
144+ ServerSocketChannel fhirStatusConnectorChannel = JettyServer .serverSocketChannel ("127.0.0.1" );
145+ ServerSocketChannel fhirApiConnectorChannel = JettyServer .serverSocketChannel ("127.0.0.1" );
150146
151147 logger .info ("Creating FHIR Bundle ..." );
152148 createTestBundle (certificates .getClientCertificate (), certificates .getExternalClientCertificate (),
153149 fhirApiConnectorChannel .socket ().getLocalPort ());
154150
155- fhirBaseUrl = "https://localhost:" + fhirApiConnectorChannel .socket ().getLocalPort () + FHIR_CONTEXT_PATH ;
151+ String fhirBaseUrl = "https://localhost:" + fhirApiConnectorChannel .socket ().getLocalPort () + FHIR_CONTEXT_PATH ;
156152
157153 logger .info ("Creating webservice client ..." );
158- webserviceClient = createWebserviceClient (fhirApiConnectorChannel . socket ().getLocalPort (),
159- certificates .getClientCertificate ().getTrustStore (), certificates . getClientCertificate (). getKeyStore (),
154+ webserviceClient = createWebserviceClient (fhirBaseUrl , certificates . getClientCertificate ().getTrustStore (),
155+ certificates .getClientCertificate ().getKeyStore (),
160156 certificates .getClientCertificate ().getKeyStorePassword (), fhirContext , referenceCleaner );
161157
162158 logger .info ("Starting FHIR Server ..." );
@@ -180,15 +176,15 @@ public static void beforeClass() throws Exception
180176 bpeLiquibaseRule .getMappedPort (5432 ), bpeLiquibaseRule .getDatabaseName ());
181177 bpeDefaultDataSource .unwrap (BasicDataSource .class ).start ();
182178
183- ServerSocketChannel bpeStatusConnectorChannel = JettyServer .serverSocketChannel ();
184- ServerSocketChannel bpeApiConnectorChannel = JettyServer .serverSocketChannel ();
179+ ServerSocketChannel bpeStatusConnectorChannel = JettyServer .serverSocketChannel ("127.0.0.1" );
180+ ServerSocketChannel bpeApiConnectorChannel = JettyServer .serverSocketChannel ("127.0.0.1" );
185181
186- bpeBaseUrl = "https://localhost:" + bpeApiConnectorChannel .socket ().getLocalPort () + BPE_CONTEXT_PATH ;
182+ String bpeBaseUrl = "https://localhost:" + bpeApiConnectorChannel .socket ().getLocalPort () + BPE_CONTEXT_PATH ;
187183
188184 Files .createDirectories (EMPTY_PROCESS_DIRECTORY );
189185
190186 logger .info ("Starting BPE Server ..." );
191- bpeServer = startBpeServer (bpeStatusConnectorChannel , bpeApiConnectorChannel , bpeBaseUrl );
187+ bpeServer = startBpeServer (bpeStatusConnectorChannel , bpeApiConnectorChannel , bpeBaseUrl , fhirBaseUrl );
192188
193189 logger .info ("Creating FHIR template database ..." );
194190 fhirLiquibaseRule .createTemplateDatabase ();
@@ -200,12 +196,11 @@ public static void beforeClass() throws Exception
200196 Thread .sleep (Duration .ofSeconds (1 ));
201197 }
202198
203- private static FhirWebserviceClient createWebserviceClient (int fhirApiPort , KeyStore trustStore , KeyStore keyStore ,
204- char [] keyStorePassword , FhirContext fhirContext , ReferenceCleaner referenceCleaner )
199+ private static FhirWebserviceClient createWebserviceClient (String fhirBaseUrl , KeyStore trustStore ,
200+ KeyStore keyStore , char [] keyStorePassword , FhirContext fhirContext , ReferenceCleaner referenceCleaner )
205201 {
206- return new FhirWebserviceClientJersey ("https://localhost:" + fhirApiPort + FHIR_CONTEXT_PATH , trustStore ,
207- keyStore , keyStorePassword , null , null , null , null , 0 , 0 , false , "DSF Integration Test Client" ,
208- fhirContext , referenceCleaner );
202+ return new FhirWebserviceClientJersey (fhirBaseUrl , trustStore , keyStore , keyStorePassword , null , null , null ,
203+ null , 0 , 0 , false , "DSF Integration Test Client" , fhirContext , referenceCleaner );
209204 }
210205
211206 protected static FhirWebserviceClient getWebserviceClient ()
@@ -394,7 +389,7 @@ private static JettyServer startFhirServer(ServerSocketChannel statusConnectorCh
394389 }
395390
396391 private static JettyServer startBpeServer (ServerSocketChannel statusConnectorChannel ,
397- ServerSocketChannel apiConnectorChannel , String baseUrl ) throws Exception
392+ ServerSocketChannel apiConnectorChannel , String bpeBaseUrl , String fhirBaseUrl ) throws Exception
398393 {
399394 Map <String , String > initParameters = new HashMap <>();
400395 initParameters .put ("dev.dsf.server.status.port" ,
@@ -416,6 +411,7 @@ private static JettyServer startBpeServer(ServerSocketChannel statusConnectorCha
416411 initParameters .put ("dev.dsf.bpe.fhir.client.trust.server.certificate.cas" ,
417412 certificates .getCaCertificateFile ().toString ());
418413
414+ initParameters .put ("dev.dsf.bpe.server.base.url" , bpeBaseUrl );
419415 initParameters .put ("dev.dsf.bpe.fhir.server.base.url" , fhirBaseUrl );
420416
421417 initParameters .put ("dev.dsf.bpe.process.api.directroy" , "../dsf-bpe-server-jetty/docker/api" );
0 commit comments