Further adaption of new config class

This commit is contained in:
jkv
2020-09-06 07:29:32 +02:00
parent 5981456e54
commit d5c6abece9
6 changed files with 55 additions and 57 deletions

View File

@@ -1,11 +1,10 @@
package ca.uhn.fhir.jpa.starter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import ca.uhn.fhir.to.FhirTesterMvcConfig;
import ca.uhn.fhir.to.TesterConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
//@formatter:off
/**
@@ -35,15 +34,15 @@ public class FhirTesterConfig {
* you might want to use that instead of using the variable.
*/
@Bean
public TesterConfig testerConfig() {
public TesterConfig testerConfig(AppProperties appProperties) {
TesterConfig retVal = new TesterConfig();
retVal
.addServer()
.withId(HapiProperties.getServerId())
.withFhirVersion(HapiProperties.getFhirVersion())
.withBaseUrl(HapiProperties.getServerAddress())
.withName(HapiProperties.getServerName());
retVal.setRefuseToFetchThirdPartyUrls(HapiProperties.getTesterConfigRefustToFetchThirdPartyUrls());
.withId(appProperties.getTester().getId())
.withFhirVersion(appProperties.getFhir_version())
.withBaseUrl(appProperties.getTester().getAddress())
.withName(appProperties.getTester().getName());
retVal.setRefuseToFetchThirdPartyUrls(appProperties.getTester().getRefuse_to_fetch_third_party_urls());
return retVal;
}