Merge pull request #211 from pukkaone/tester-client-factory
FHIR Tester application use configured client factory
This commit is contained in:
commit
d6540a9759
|
@ -1112,7 +1112,8 @@ public class Controller {
|
|||
}
|
||||
|
||||
private Conformance loadAndAddConfDstu1(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) {
|
||||
IGenericClient client = getContext(theRequest).newRestfulGenericClient(theRequest.getServerBase(theServletRequest, myConfig));
|
||||
CaptureInterceptor interceptor = new CaptureInterceptor();
|
||||
GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor);
|
||||
|
||||
Conformance conformance;
|
||||
try {
|
||||
|
@ -1171,7 +1172,8 @@ public class Controller {
|
|||
}
|
||||
|
||||
private IResource loadAndAddConfDstu2(HttpServletRequest theServletRequest, final HomeRequest theRequest, final ModelMap theModel) {
|
||||
IGenericClient client = getContext(theRequest).newRestfulGenericClient(theRequest.getServerBase(theServletRequest, myConfig));
|
||||
CaptureInterceptor interceptor = new CaptureInterceptor();
|
||||
GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor);
|
||||
|
||||
ca.uhn.fhir.model.dstu2.resource.Conformance conformance;
|
||||
try {
|
||||
|
|
|
@ -19,6 +19,7 @@ import ca.uhn.fhir.rest.server.EncodingEnum;
|
|||
import ca.uhn.fhir.rest.server.IncomingRequestAddressStrategy;
|
||||
import ca.uhn.fhir.to.Controller;
|
||||
import ca.uhn.fhir.to.TesterConfig;
|
||||
import ca.uhn.fhir.util.ITestingUiClientFactory;
|
||||
|
||||
public class HomeRequest {
|
||||
|
||||
|
@ -123,8 +124,18 @@ public class HomeRequest {
|
|||
|
||||
public GenericClient newClient(HttpServletRequest theRequest, FhirContext theContext, TesterConfig theConfig, Controller.CaptureInterceptor theInterceptor) {
|
||||
theContext.getRestfulClientFactory().setServerValidationMode(ServerValidationModeEnum.NEVER);
|
||||
|
||||
GenericClient retVal = (GenericClient) theContext.newRestfulGenericClient(getServerBase(theRequest, theConfig));
|
||||
|
||||
GenericClient retVal;
|
||||
ITestingUiClientFactory clientFactory = theConfig.getClientFactory();
|
||||
if (clientFactory != null) {
|
||||
retVal = (GenericClient) clientFactory.newClient(
|
||||
theContext,
|
||||
theRequest,
|
||||
getServerBase(theRequest, theConfig));
|
||||
} else {
|
||||
retVal = (GenericClient) theContext.newRestfulGenericClient(getServerBase(theRequest, theConfig));
|
||||
}
|
||||
|
||||
retVal.setKeepResponses(true);
|
||||
|
||||
if ("true".equals(getPretty())) {
|
||||
|
|
|
@ -70,8 +70,8 @@
|
|||
</overlays>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</build>
|
||||
</plugins>]]></source>
|
||||
</plugins>
|
||||
</build>]]></source>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
Loading…
Reference in New Issue