diff --git a/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/D2ErrorCollectionRepositoryMockIntegrationShould.java b/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/D2ErrorCollectionRepositoryMockIntegrationShould.java index 80438efe03..45e9945ee5 100644 --- a/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/D2ErrorCollectionRepositoryMockIntegrationShould.java +++ b/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/D2ErrorCollectionRepositoryMockIntegrationShould.java @@ -67,7 +67,7 @@ public void filter_d2_error_by_d2_error_code() { public void filter_d2_error_by_d2_error_component() { List d2Errors = d2.maintenanceModule().d2Errors() .byD2ErrorComponent().eq(D2ErrorComponent.Server).blockingGet(); - assertThat(d2Errors.size()).isEqualTo(2); + assertThat(d2Errors.size()).isEqualTo(4); } @Test @@ -105,6 +105,6 @@ public void filter_d2_error_by_created() { List d2Errors = d2.maintenanceModule().d2Errors() .byCreated().inPeriods(Lists.newArrayList(todayPeriod)).blockingGet(); - assertThat(d2Errors.size()).isEqualTo(3); + assertThat(d2Errors.size()).isEqualTo(5); } } \ No newline at end of file diff --git a/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/MaintenanceMockIntegrationShould.java b/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/MaintenanceMockIntegrationShould.java index b10674fd8e..e9a89c9c23 100644 --- a/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/MaintenanceMockIntegrationShould.java +++ b/core/src/androidTest/java/org/hisp/dhis/android/testapp/maintenance/MaintenanceMockIntegrationShould.java @@ -83,6 +83,6 @@ public void get_vulnerabilities_for_low_threshold() { @Test public void allow_access_to_d2_errors() { List d2Errors = d2.maintenanceModule().d2Errors().blockingGet(); - assertThat(d2Errors.size()).isEqualTo(3); + assertThat(d2Errors.size()).isEqualTo(5); } } \ No newline at end of file diff --git a/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityAttributeValueCollectionRepositoryMockIntegrationShould.java b/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityAttributeValueCollectionRepositoryMockIntegrationShould.java index 848dde12f0..8bbc10942a 100644 --- a/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityAttributeValueCollectionRepositoryMockIntegrationShould.java +++ b/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityAttributeValueCollectionRepositoryMockIntegrationShould.java @@ -51,7 +51,7 @@ public class TrackedEntityAttributeValueCollectionRepositoryMockIntegrationShoul public void allow_access_to_all_tracked_entity_data_values() { List trackedEntityAttributeValues = d2.trackedEntityModule().trackedEntityAttributeValues().blockingGet(); - assertThat(trackedEntityAttributeValues.size()).isEqualTo(3); + assertThat(trackedEntityAttributeValues.size()).isEqualTo(4); } @Test diff --git a/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityInstanceCollectionRepositoryMockIntegrationShould.java b/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityInstanceCollectionRepositoryMockIntegrationShould.java index de27979021..f5537536d6 100644 --- a/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityInstanceCollectionRepositoryMockIntegrationShould.java +++ b/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/TrackedEntityInstanceCollectionRepositoryMockIntegrationShould.java @@ -69,11 +69,11 @@ public void include_tracked_entity_attribute_values_as_children() { TrackedEntityInstance tei = d2.trackedEntityModule().trackedEntityInstances() .withTrackedEntityAttributeValues().uid("nWrB0TfWlvD").blockingGet(); - assertThat(tei.trackedEntityAttributeValues().size()).isEqualTo(1); + assertThat(tei.trackedEntityAttributeValues().size()).isEqualTo(2); - assertThat(tei.trackedEntityAttributeValues().get(0).trackedEntityAttribute()).isEqualTo("cejWyOfXge6"); - assertThat(tei.trackedEntityAttributeValues().get(0).value()).isEqualTo("654321"); + assertThat(tei.trackedEntityAttributeValues().get(0).trackedEntityAttribute()).isEqualTo("aejWyOfXge6"); + assertThat(tei.trackedEntityAttributeValues().get(0).value()).isEqualTo("aefryrfXge5"); } @Test diff --git a/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/search/TrackedEntitySearchCollectionRepositoryMockIntegrationShould.kt b/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/search/TrackedEntitySearchCollectionRepositoryMockIntegrationShould.kt index 03c269e854..9b79f88c3e 100644 --- a/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/search/TrackedEntitySearchCollectionRepositoryMockIntegrationShould.kt +++ b/core/src/androidTest/java/org/hisp/dhis/android/testapp/trackedentity/search/TrackedEntitySearchCollectionRepositoryMockIntegrationShould.kt @@ -77,7 +77,7 @@ class TrackedEntitySearchCollectionRepositoryMockIntegrationShould : .blockingGet() assertThat(trackedEntityInstances[0].header).isEqualTo("4081507, befryEfXge5") - assertThat(trackedEntityInstances[1].header).isEqualTo("654321, ") + assertThat(trackedEntityInstances[1].header).isEqualTo("654321, aefryrfXge5") } @Test diff --git a/core/src/main/java/org/hisp/dhis/android/core/fileresource/internal/FileResourceDownloadCall.kt b/core/src/main/java/org/hisp/dhis/android/core/fileresource/internal/FileResourceDownloadCall.kt index 574bbb8f38..c7c90f1a48 100644 --- a/core/src/main/java/org/hisp/dhis/android/core/fileresource/internal/FileResourceDownloadCall.kt +++ b/core/src/main/java/org/hisp/dhis/android/core/fileresource/internal/FileResourceDownloadCall.kt @@ -39,6 +39,7 @@ import org.hisp.dhis.android.core.arch.call.fetchers.internal.UidsNoResourceCall import org.hisp.dhis.android.core.arch.call.internal.D2ProgressManager import org.hisp.dhis.android.core.arch.call.queries.internal.UidsQuery import org.hisp.dhis.android.core.arch.helpers.FileResizerHelper +import org.hisp.dhis.android.core.arch.helpers.Result import org.hisp.dhis.android.core.common.State import org.hisp.dhis.android.core.common.ValueType import org.hisp.dhis.android.core.fileresource.FileResource @@ -253,12 +254,20 @@ internal class FileResourceDownloadCall( private suspend fun getIdsValuePairsSequentially(valueMap: Map): List> { return valueMap.mapNotNull { (uid, value) -> uid?.let { - val fileResource = coroutineAPICallExecutor.wrap { + val frResult = coroutineAPICallExecutor.wrap { fileResourceService.getFileResource( uid, ) - }.getOrThrow() - Pair(fileResource, value) + } + when (frResult) { + is Result.Success -> { + Pair(frResult.value, value) + } + is Result.Failure -> { + Log.v(FileResourceDownloadCall::class.java.canonicalName, frResult.failure.errorDescription()) + null + } + } } } } diff --git a/core/src/sharedTest/resources/trackedentity/new_tracker_importer_tracked_entities.json b/core/src/sharedTest/resources/trackedentity/new_tracker_importer_tracked_entities.json index 35740298e2..050f131a43 100644 --- a/core/src/sharedTest/resources/trackedentity/new_tracker_importer_tracked_entities.json +++ b/core/src/sharedTest/resources/trackedentity/new_tracker_importer_tracked_entities.json @@ -231,6 +231,12 @@ "createdAt": "2018-01-10T13:40:28.000", "attribute": "cejWyOfXge6", "value": "654321" + }, + { + "updatedAt": "2019-01-11T13:40:28.000", + "createdAt": "2019-01-11T13:40:28.000", + "attribute": "aejWyOfXge6", + "value": "aefryrfXge5" } ], "enrollments": [ diff --git a/core/src/sharedTest/resources/trackedentity/tracked_entity_instances.json b/core/src/sharedTest/resources/trackedentity/tracked_entity_instances.json index aeb27b33d3..fa71c3f020 100644 --- a/core/src/sharedTest/resources/trackedentity/tracked_entity_instances.json +++ b/core/src/sharedTest/resources/trackedentity/tracked_entity_instances.json @@ -226,6 +226,12 @@ "created": "2018-01-10T13:40:28.000", "attribute": "cejWyOfXge6", "value": "654321" + }, + { + "lastUpdated": "2019-01-11T13:40:28.000", + "created": "2019-01-11T13:40:28.000", + "attribute": "aejWyOfXge6", + "value": "aefryrfXge5" } ], "enrollments": [ diff --git a/docs/content/developer/getting-started.md b/docs/content/developer/getting-started.md index 271f91bae7..8f767ae9ea 100644 --- a/docs/content/developer/getting-started.md +++ b/docs/content/developer/getting-started.md @@ -6,7 +6,7 @@ Include dependency in build.gradle. ```gradle dependencies { - implementation "org.hisp.dhis:android-core:1.10.0.1" + implementation "org.hisp.dhis:android-core:1.10.1" ... } ```