@Test public void shouldNotParseIncompletedForm() throws SetupConfigurationController.SetupConfigurationFetchException { when(formWebViewActivity.getString(anyInt())).thenReturn("success"); SetupConfigurationTemplate setupConfigurationTemplate = new SetupConfigurationTemplate(); setupConfigurationTemplate.setUuid("dummySetupConfig"); when(setupConfigurationController.getActiveSetupConfigurationTemplate()).thenReturn(setupConfigurationTemplate); String jsonPayLoad = readFile(); htmlFormDataStore.saveHTML(jsonPayLoad, Constants.STATUS_INCOMPLETE); verify(htmlFormObservationCreator, times(0)).createAndPersistObservations(jsonPayLoad,formData.getUuid()); }
@JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); }
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } }
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } HTMLFormDataStore(HTMLFormWebViewActivity formWebViewActivity, FormData formData, boolean isFormReload, MuzimaApplication application); }
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } HTMLFormDataStore(HTMLFormWebViewActivity formWebViewActivity, FormData formData, boolean isFormReload, MuzimaApplication application); @JavascriptInterface String getStatus(); @JavascriptInterface void saveHTML(String jsonPayload, String status); @JavascriptInterface void saveHTML(String jsonPayload, String status, boolean keepFormOpen); @JavascriptInterface String getLocationNamesFromDevice(); @JavascriptInterface String getRelationshipTypesFromDevice(); @JavascriptInterface String getPatientDetailsFromServerByUuid(String uuid); @JavascriptInterface String getPersonDetailsFromDeviceByUuid(String uuid); @JavascriptInterface String searchPersons(String searchTerm, boolean searchServer); @JavascriptInterface String searchPersonsLocally(String searchTerm); @JavascriptInterface String searchPatientOnServer(String searchTerm); @JavascriptInterface String getProviderNamesFromDevice(); @JavascriptInterface String getDefaultEncounterProvider(); @JavascriptInterface String getFontSizePreference(); Date getEncounterDateFromForm(String jsonPayload); @JavascriptInterface String getStringResource(String stringResourceName); @JavascriptInterface String getConcepts(); @JavascriptInterface String getEncountersByPatientUuid(String patientuuid); @JavascriptInterface String getEncounterTypes(String patientuuid); @JavascriptInterface String getObsByConceptId(String patientUuid, int conceptId); @JavascriptInterface String getObsByEncounterId(int encounterid); @JavascriptInterface String getObsByEncounterType(String patientUuid, String encounterType); @JavascriptInterface boolean isMedicalRecordNumberRequired(); @JavascriptInterface void checkForPossibleFormDuplicate(String formUuid, String encounterDateTime, String patientUuid, String encounterPayLoad); @JavascriptInterface boolean getDefaultEncounterLocationSetting(); @JavascriptInterface String getDefaultEncounterLocationPreference(); @JavascriptInterface String getLastKnowGPSLocation(String jsonReturnType); @JavascriptInterface void logEvent(String tag, String details); @JavascriptInterface String getCohortMembershipByPatientUuid(String patientUuid); @JavascriptInterface void createPersonAndDiscardHTML(String jsonPayload); }
HTMLFormDataStore { @JavascriptInterface public void saveHTML(String jsonPayload, String status) { saveHTML(jsonPayload, status, false); } HTMLFormDataStore(HTMLFormWebViewActivity formWebViewActivity, FormData formData, boolean isFormReload, MuzimaApplication application); @JavascriptInterface String getStatus(); @JavascriptInterface void saveHTML(String jsonPayload, String status); @JavascriptInterface void saveHTML(String jsonPayload, String status, boolean keepFormOpen); @JavascriptInterface String getLocationNamesFromDevice(); @JavascriptInterface String getRelationshipTypesFromDevice(); @JavascriptInterface String getPatientDetailsFromServerByUuid(String uuid); @JavascriptInterface String getPersonDetailsFromDeviceByUuid(String uuid); @JavascriptInterface String searchPersons(String searchTerm, boolean searchServer); @JavascriptInterface String searchPersonsLocally(String searchTerm); @JavascriptInterface String searchPatientOnServer(String searchTerm); @JavascriptInterface String getProviderNamesFromDevice(); @JavascriptInterface String getDefaultEncounterProvider(); @JavascriptInterface String getFontSizePreference(); Date getEncounterDateFromForm(String jsonPayload); @JavascriptInterface String getStringResource(String stringResourceName); @JavascriptInterface String getConcepts(); @JavascriptInterface String getEncountersByPatientUuid(String patientuuid); @JavascriptInterface String getEncounterTypes(String patientuuid); @JavascriptInterface String getObsByConceptId(String patientUuid, int conceptId); @JavascriptInterface String getObsByEncounterId(int encounterid); @JavascriptInterface String getObsByEncounterType(String patientUuid, String encounterType); @JavascriptInterface boolean isMedicalRecordNumberRequired(); @JavascriptInterface void checkForPossibleFormDuplicate(String formUuid, String encounterDateTime, String patientUuid, String encounterPayLoad); @JavascriptInterface boolean getDefaultEncounterLocationSetting(); @JavascriptInterface String getDefaultEncounterLocationPreference(); @JavascriptInterface String getLastKnowGPSLocation(String jsonReturnType); @JavascriptInterface void logEvent(String tag, String details); @JavascriptInterface String getCohortMembershipByPatientUuid(String patientUuid); @JavascriptInterface void createPersonAndDiscardHTML(String jsonPayload);  }