diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16154ec94..3d565f9fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,10 +25,10 @@ jobs: - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Run unit tests with Gradle - run: ./gradlew :opensrp-child:jacocoTestReport --stacktrace -Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError" + run: ./gradlew :opensrp-child:jacocoTestReport --stacktrace -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError" - name: Generate Javadoc with Gradle run: ./gradlew javadoc - name: Upload coverage to Coveralls with Gradle run: ./gradlew :opensrp-child:coveralls --stacktrace env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} \ No newline at end of file + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }} diff --git a/opensrp-child/build.gradle b/opensrp-child/build.gradle index 94904fcee..b7a7b51b5 100644 --- a/opensrp-child/build.gradle +++ b/opensrp-child/build.gradle @@ -140,7 +140,7 @@ dependencies { exclude group: 'com.android.support', module: 'appcompat-v7' } - api('org.smartregister:opensrp-client-immunization:4.0.0-SNAPSHOT@aar') { + api('org.smartregister:opensrp-client-immunization:4.0.2-SNAPSHOT@aar') { transitive = true exclude group: 'org.smartregister', module: 'opensrp-client-core' exclude group: 'org.smartregister', module: 'opensrp-client-native-form' diff --git a/opensrp-child/src/main/java/org/smartregister/child/util/Utils.java b/opensrp-child/src/main/java/org/smartregister/child/util/Utils.java index 806ba2191..c543c82fd 100644 --- a/opensrp-child/src/main/java/org/smartregister/child/util/Utils.java +++ b/opensrp-child/src/main/java/org/smartregister/child/util/Utils.java @@ -211,7 +211,7 @@ public static void addVaccine(VaccineRepository vaccineRepository, Vaccine vacci String providerId = allSharedPreferences.fetchRegisteredANM(); vaccine.setTeam(allSharedPreferences.fetchDefaultTeam(providerId)); vaccine.setTeamId(allSharedPreferences.fetchDefaultTeamId(providerId)); - + vaccine.setOutreach(vaccine.getLocationId().equals(allSharedPreferences.fetchDefaultLocalityId(providerId))? 0 : 1); vaccine.setName(vaccine.getName().trim()); // Add the vaccine vaccineRepository.add(vaccine); diff --git a/opensrp-child/src/test/java/org/smartregister/child/utils/UtilsTest.java b/opensrp-child/src/test/java/org/smartregister/child/utils/UtilsTest.java index 2a0583368..0a3bf8079 100644 --- a/opensrp-child/src/test/java/org/smartregister/child/utils/UtilsTest.java +++ b/opensrp-child/src/test/java/org/smartregister/child/utils/UtilsTest.java @@ -138,9 +138,11 @@ public void getCombinedVaccineWithNonNullArgument() { public void addVaccineWithVaccineRepositoryOrVaccineNotNull() { Vaccine vaccine = new Vaccine(); vaccine.setName("testvaccine"); + vaccine.setLocationId("location1"); + vaccine.setOutreach(1); + Assert.assertNotNull(vaccine); Utils.addVaccine(vaccineRepository, vaccine); - Mockito.verify(vaccineRepository, Mockito.times(1)).add(vaccineArgumentCaptor.capture()); - Assert.assertEquals(vaccine, vaccineArgumentCaptor.getValue()); + Mockito.verify(vaccineRepository, Mockito.times(1)).add(vaccine); } @Test