Skip to content

Commit

Permalink
Merge pull request #43 from ubap/SYNCT-76
Browse files Browse the repository at this point in the history
SYNCT-76: Update to latest changes in FHIR module
  • Loading branch information
pkornowski committed Dec 29, 2017
2 parents 70a27ef + fec7edd commit f956e34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -25,7 +25,7 @@ public Object pullDataFromParent(String category, String clientName, String push

ClientFactory clientFactory = new ClientFactory();
Client client = clientFactory.createClient(clientName);
return client.getObject(category, pushUrl, username, password);
return client.retrieveObject(category, pushUrl, username, password);
}

public ResponseEntity<String> pushDataToParent(Object object, String clientName, String pushUrl) {
Expand All @@ -34,7 +34,7 @@ public ResponseEntity<String> pushDataToParent(Object object, String clientName,

Client client = new ClientFactory().createClient(clientName);
try {
return client.postObject(pushUrl, username, password, object);
return client.createObject(pushUrl, username, password, object);
} catch (HttpClientErrorException | HttpServerErrorException e) {
throw new SyncException(String.format("Object posting error. Code: %d. Details: \n%s",
e.getStatusCode().value(), e.getResponseBodyAsString()), e);
Expand Down
Expand Up @@ -31,7 +31,7 @@ public RestClient(ClientHttpRequestFactory clientHttpRequestFactory) {
}

@Override
public Object getObject(String category, String url, String username, String password)
public Object retrieveObject(String category, String url, String username, String password)
throws RestClientException {
restTemplate.setInterceptors(Arrays.asList(new BasicAuthInterceptor(username, password)));

Expand All @@ -40,7 +40,7 @@ public Object getObject(String category, String url, String username, String pas
}

@Override
public ResponseEntity<String> postObject(String url, String username, String password, Object object)
public ResponseEntity<String> createObject(String url, String username, String password, Object object)
throws RestClientException {
restTemplate.setInterceptors(Arrays.asList(new BasicAuthInterceptor(username, password)));

Expand Down
Expand Up @@ -73,10 +73,10 @@ public void setUp() throws Exception {


RestClient restClientMock = mock(RestClient.class);
doReturn(createPatient()).when(restClientMock).getObject(PATIENT_CATEGORY, REST_FULL_RESOURCE_URL, USERNAME, PASSWORD);
doReturn(createPatient()).when(restClientMock).retrieveObject(PATIENT_CATEGORY, REST_FULL_RESOURCE_URL, USERNAME, PASSWORD);

FHIRClient fhirClientMock = mock(FHIRClient.class);
doReturn(createPatient()).when(fhirClientMock).getObject(PATIENT_CATEGORY, FHIR_FULL_RESOURCE_URL, USERNAME, PASSWORD);
doReturn(createPatient()).when(fhirClientMock).retrieveObject(PATIENT_CATEGORY, FHIR_FULL_RESOURCE_URL, USERNAME, PASSWORD);

ClientFactory clientFactory = mock(ClientFactory.class);
doReturn(restClientMock).when(clientFactory).createClient(REST_CLIENT_KEY);
Expand Down

0 comments on commit f956e34

Please sign in to comment.