test_class.file: app/src/test/java/org/eyeseetea/malariacare/data/sync/mappers/PushReportMapperTest.java
test_class.identifier: PushReportMapperTest
test_case.body: @Test
      public void test_conversion_of_success_import_summary() throws IOException {
          ImportSummary importSummary = givenAImportSummary(IMPORT_SUMMARY_SUCCESS_RESPONSE);
  
          PushReport pushReport = PushReportMapper.mapFromImportSummaryToPushReport(importSummary,
                  EVENT_UID_KEY);
          //then
          assertThat(pushReport.getDescription().equals(importSummary.getDescription()), is(true));
          assertThat(pushReport.getEventUid().equals(importSummary.getReference()), is(true));
          assertThat(pushReport.getHref().equals(importSummary.getHref()), is(true));
          assertThat((pushReport.getStatus().equals(PushReport.Status.SUCCESS)), is(true));
          assertThat((importSummary.getStatus().equals(ImportSummary.Status.SUCCESS)), is(true));
          assertThat(pushReport.getPushedValues().getImported() == (importSummary.getImportCount()
                  .getImported()), is(true));
          assertThat(pushReport.getPushedValues().getDeleted() == (importSummary.getImportCount()
                  .getDeleted()), is(true));
          assertThat(pushReport.getPushedValues().getIgnored() == (importSummary.getImportCount()
                  .getIgnored()), is(true));
          assertThat(pushReport.getPushedValues().getUpdated() == (importSummary.getImportCount()
                  .getUpdated()), is(true));
          assertThat(pushReport.getPushConflicts().isEmpty(), is(true));
      }
test_case.class_method_signature: PushReportMapperTest.test_conversion_of_success_import_summary()
test_case.full_signature: @Test public void test_conversion_of_success_import_summary()
test_case.identifier: test_conversion_of_success_import_summary
test_case.invocations: givenAImportSummary mapFromImportSummaryToPushReport assertThat equals getDescription getDescription is assertThat equals getEventUid getReference is assertThat equals getHref getHref is assertThat equals getStatus is assertThat equals getStatus is assertThat getImported getPushedValues getImported getImportCount is assertThat getDeleted getPushedValues getDeleted getImportCount is assertThat getIgnored getPushedValues getIgnored getImportCount is assertThat getUpdated getPushedValues getUpdated getImportCount is assertThat isEmpty getPushConflicts is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_conversion_of_success_import_summary()
focal_class.file: app/src/main/java/org/eyeseetea/malariacare/data/sync/mappers/PushReportMapper.java
focal_class.identifier: PushReportMapper
focal_class.class_method_signature: PushReportMapper.mapFromImportSummariesToPushReports(
              Map<java.lang.String, ImportSummary> mapEventsImportSummary)
focal_class.full_signature: public static Map<String, PushReport> mapFromImportSummariesToPushReports(
              Map<java.lang.String, ImportSummary> mapEventsImportSummary)
focal_class.identifier: mapFromImportSummariesToPushReports
focal_class.modifiers: public static
focal_class.parameters: (
              Map<java.lang.String, ImportSummary> mapEventsImportSummary)
focal_class.return: Map<String, PushReport>
focal_class.signature: Map<String, PushReport> mapFromImportSummariesToPushReports(
              Map<java.lang.String, ImportSummary> mapEventsImportSummary)
focal_class.class_method_signature: PushReportMapper.mapFromImportSummaryToPushReport(ImportSummary importSummary,
              String importSummaryKey)
focal_class.full_signature: public static PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary,
              String importSummaryKey)
focal_class.identifier: mapFromImportSummaryToPushReport
focal_class.modifiers: public static
focal_class.parameters: (ImportSummary importSummary,
              String importSummaryKey)
focal_class.return: PushReport
focal_class.signature: PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary,
              String importSummaryKey)
focal_method.body: public static PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary,
              String importSummaryKey) {
          PushReport pushReport = new PushReport();
          List<PushConflict> conflictList = new ArrayList<>();
          if (importSummary.getConflicts() != null) {
              for (Conflict conflict : importSummary.getConflicts()) {
                  conflictList.add(
                          new PushConflict(conflict.getObject(), conflict.getValue()));
              }
          }
          pushReport.setPushConflicts(conflictList);
          pushReport.setDescription(importSummary.getDescription());
          pushReport.setHref(importSummary.getHref());
  
          ImportCount importCount = importSummary.getImportCount();
          if(importCount!=null) {
              pushReport.setPushedValuesCount(
                      new PushedValuesCount(importCount.getImported(), importCount.getUpdated(),
                              importCount.getIgnored(), importCount.getDeleted()));
  
          }
          pushReport.setReference(importSummary.getReference());
          if (importSummary.getStatus() == ImportSummary.Status.ERROR) {
              pushReport.setStatus(PushReport.Status.ERROR);
          }
          if (importSummary.getStatus() == ImportSummary.Status.OK) {
              pushReport.setStatus(PushReport.Status.OK);
          }
          if (importSummary.getStatus() == ImportSummary.Status.SUCCESS) {
              pushReport.setStatus(PushReport.Status.SUCCESS);
          }
          pushReport.setEventUid(importSummaryKey);
          return pushReport;
      }
focal_method.class_method_signature: PushReportMapper.mapFromImportSummaryToPushReport(ImportSummary importSummary,
              String importSummaryKey)
focal_method.full_signature: public static PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary,
              String importSummaryKey)
focal_method.identifier: mapFromImportSummaryToPushReport
focal_method.invocations: getConflicts getConflicts add getObject getValue setPushConflicts setDescription getDescription setHref getHref getImportCount setPushedValuesCount getImported getUpdated getIgnored getDeleted setReference getReference getStatus setStatus getStatus setStatus getStatus setStatus setEventUid
focal_method.modifiers: public static
focal_method.parameters: (ImportSummary importSummary,
              String importSummaryKey)
focal_method.return: PushReport
focal_method.signature: PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary,
              String importSummaryKey)