ca.uhn.fhir.rest.client.apache.ApacheRestfulClientFactory

Here are the examples of the java api class ca.uhn.fhir.rest.client.apache.ApacheRestfulClientFactory taken from open source projects.

1. GenericClientDstu2Test#testProviderWhereWeForgotToSetTheContext()

Project: hapi-fhir
File: GenericClientDstu2Test.java
@Test
public void testProviderWhereWeForgotToSetTheContext() throws Exception {
    // no ctx
    ApacheRestfulClientFactory clientFactory = new ApacheRestfulClientFactory();
    clientFactory.setServerValidationMode(ServerValidationModeEnum.NEVER);
    ourCtx.setRestfulClientFactory(clientFactory);
    try {
        ourCtx.newRestfulGenericClient("http://localhost:8080/fhir");
        fail();
    } catch (IllegalStateException e) {
        assertEquals("ApacheRestfulClientFactory does not have FhirContext defined. This must be set via ApacheRestfulClientFactory#setFhirContext(FhirContext)", e.getMessage());
    }
}