use of org.hisp.dhis.android.core.imports.WebResponse in project dhis2-android-sdk by dhis2.
the class EventPostCall method handleWebResponse.
private void handleWebResponse(Response<WebResponse> response) {
WebResponse webResponse = response.body();
EventImportHandler eventImportHandler = new EventImportHandler(eventStore);
eventImportHandler.handleEventImportSummaries(webResponse.importSummaries().importSummaries());
}
use of org.hisp.dhis.android.core.imports.WebResponse in project dhis2-android-sdk by dhis2.
the class TrackedEntityInstancePostCallRealIntegrationShould method response_true_when_data_sync.
/*
* If you want run this test you need config the correct uids in the server side.
* At this moment is necessary add into the "child programme" program the category combo : Implementing Partner
* */
// @Test
public void response_true_when_data_sync() throws Exception {
Response response = null;
downloadMetadata();
createDummyDataToPost(orgUnitUid, programUid, programStageUid, trackedEntityUid, coordinates, featureType, eventUid, enrollmentUid, trackedEntityInstanceUid, trackedEntityAttributeUid, dataElementUid);
createDummyDataToPost(orgUnitUid, programUid, programStageUid, trackedEntityUid, coordinates, featureType, event1Uid, enrollment1Uid, trackedEntityInstance1Uid, trackedEntityAttributeUid, dataElementUid);
Call<Response<WebResponse>> call = d2.syncTrackedEntityInstances();
response = call.call();
assertThat(response.isSuccessful()).isTrue();
}
use of org.hisp.dhis.android.core.imports.WebResponse in project dhis2-android-sdk by dhis2.
the class TrackedEntityInstancePostCall method handleWebResponse.
private void handleWebResponse(Response<WebResponse> response) {
WebResponse webResponse = response.body();
EventImportHandler eventImportHandler = new EventImportHandler(eventStore);
EnrollmentImportHandler enrollmentImportHandler = new EnrollmentImportHandler(enrollmentStore, eventImportHandler);
TrackedEntityInstanceImportHandler trackedEntityInstanceImportHandler = new TrackedEntityInstanceImportHandler(trackedEntityInstanceStore, enrollmentImportHandler, eventImportHandler);
WebResponseHandler webResponseHandler = new WebResponseHandler(trackedEntityInstanceImportHandler);
webResponseHandler.handleWebResponse(webResponse);
}
use of org.hisp.dhis.android.core.imports.WebResponse in project dhis2-android-sdk by dhis2.
the class EventPostCallRealIntegrationShould method pushDummyEvent.
private void pushDummyEvent() throws Exception {
Response response;
Call<Response<WebResponse>> call = d2.syncSingleEvents();
response = call.call();
assertThat(response.isSuccessful()).isTrue();
}
use of org.hisp.dhis.android.core.imports.WebResponse in project dhis2-android-sdk by dhis2.
the class EventPostCallRealIntegrationShould method successful_response_after_sync_events.
// commented out since it is a flaky test that works against a real server.
// @Test
public void successful_response_after_sync_events() throws Exception {
retrofit2.Response response = null;
response = d2.logIn(user, password).call();
assertThat(response.isSuccessful()).isTrue();
response = d2.syncMetaData().call();
assertThat(response.isSuccessful()).isTrue();
createDummyDataToPost(orgUnitUid, programUid, programStageUid, eventUid, dataElementUid, attributeCategoryOption, attributeOptionCombo, null);
Call<Response<WebResponse>> call = d2.syncSingleEvents();
response = call.call();
assertThat(response.isSuccessful()).isTrue();
}
Aggregations