target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void shouldDelegateANCRegistrationOAFormSubmissionHandlingToANCRegistrationOAHandler() throws Exception { FormSubmission formSubmission = create().withFormName("anc_registration_oa").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).th...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateANCVisitFormSubmissionHandlingToANCVisitHandler() throws Exception { FormSubmission formSubmission = create().withFormName("anc_visit").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); ro...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateANCCloseFormSubmissionHandlingToANCCloseHandler() throws Exception { FormSubmission formSubmission = create().withFormName("anc_close").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); ro...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateTTFormSubmissionHandlingToTTHandler() throws Exception { FormSubmission formSubmission = create().withFormName("tt").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); router.route("instanc...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateTTBoosterFormSubmissionHandlingToTTHandler() throws Exception { FormSubmission formSubmission = create().withFormName("tt_booster").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); router...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void testHasPropertyReturnsCorrectValue() { AppProperties properties = new AppProperties(); Boolean value = properties.hasProperty(PROP_KEY); Assert.assertNotNull(value); Assert.assertFalse(value); properties.setProperty(PROP_KEY, TEST_VAL); value = properties.hasProperty(PROP_KEY); Assert.assertNotNull(va...
public Boolean hasProperty(String key) { return getProperty(key) != null; }
AppProperties extends Properties { public Boolean hasProperty(String key) { return getProperty(key) != null; } }
AppProperties extends Properties { public Boolean hasProperty(String key) { return getProperty(key) != null; } }
AppProperties extends Properties { public Boolean hasProperty(String key) { return getProperty(key) != null; } Boolean getPropertyBoolean(String key); Boolean hasProperty(String key); Boolean isTrue(String key); }
AppProperties extends Properties { public Boolean hasProperty(String key) { return getProperty(key) != null; } Boolean getPropertyBoolean(String key); Boolean hasProperty(String key); Boolean isTrue(String key); }
@Test public void assertTryParseWithInvalidValue() { Assert.assertEquals(FloatUtil.tryParse("invalid", 1.0f), 1.0f); Assert.assertEquals(FloatUtil.tryParse("invalid", "1"), "1"); }
public static Float tryParse(String value, Float defaultValue) { try { return Float.parseFloat(value); } catch (NumberFormatException e) { return defaultValue; } }
FloatUtil { public static Float tryParse(String value, Float defaultValue) { try { return Float.parseFloat(value); } catch (NumberFormatException e) { return defaultValue; } } }
FloatUtil { public static Float tryParse(String value, Float defaultValue) { try { return Float.parseFloat(value); } catch (NumberFormatException e) { return defaultValue; } } }
FloatUtil { public static Float tryParse(String value, Float defaultValue) { try { return Float.parseFloat(value); } catch (NumberFormatException e) { return defaultValue; } } static Float tryParse(String value, Float defaultValue); static String tryParse(String value, String defaultValue); }
FloatUtil { public static Float tryParse(String value, Float defaultValue) { try { return Float.parseFloat(value); } catch (NumberFormatException e) { return defaultValue; } } static Float tryParse(String value, Float defaultValue); static String tryParse(String value, String defaultValue); }
@Test public void shouldDelegateTT1FormSubmissionHandlingToTTHandler() throws Exception { FormSubmission formSubmission = create().withFormName("tt_1").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); router.route("inst...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateTT2FormSubmissionHandlingToTTHandler() throws Exception { FormSubmission formSubmission = create().withFormName("tt_2").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); router.route("inst...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateIFAFormSubmissionHandlingToIFAHandler() throws Exception { FormSubmission formSubmission = create().withFormName("ifa").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); router.route("inst...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateHBTestFormSubmissionHandlingToHBTestHandler() throws Exception { FormSubmission formSubmission = create().withFormName("hb_test").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); router.r...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateDeliveryOutcomeFormSubmissionHandlingToDeliveryOutcomeHandler() throws Exception { FormSubmission formSubmission = create().withFormName("delivery_outcome").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenRetur...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegatePNCRegistrationFormSubmissionHandlingToPNCRegistrationHandler() throws Exception { FormSubmission formSubmission = create().withFormName("pnc_registration_oa").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenRe...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegatePNCVisitFormSubmissionHandlingToPNCVisitHandler() throws Exception { FormSubmission formSubmission = create().withFormName("pnc_visit").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); ro...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegatePNCCloseFormSubmissionHandlingToPNCCloseHandler() throws Exception { FormSubmission formSubmission = create().withFormName("pnc_close").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); ro...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateChildImmunizationsFormSubmissionHandlingToChildImmunizationsHandler() throws Exception { FormSubmission formSubmission = create().withFormName("child_immunizations").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1"))....
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateChildRegistrationECFormSubmissionHandlingToChildRegistrationECHandler() throws Exception { FormSubmission formSubmission = create().withFormName("child_registration_ec").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void assertShouldCapitalize() throws Exception { org.junit.Assert.assertEquals("Abc", org.smartregister.util.StringUtil.humanize("abc")); org.junit.Assert.assertEquals("Abc", org.smartregister.util.StringUtil.humanize("Abc")); }
public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharacter); static String replaceAndHumanizeWithInitCapText(String value, S...
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharacter); static String replaceAndHumanizeWithInitCapText(String value, S...
@Test public void shouldDelegateChildCloseFormSubmissionHandlingToChildCloseHandler() throws Exception { FormSubmission formSubmission = create().withFormName("child_close").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmissio...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateChildIllnessFormSubmissionHandlingToChildIllnessHandler() throws Exception { FormSubmission formSubmission = create().withFormName("child_illness").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSub...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateVitaminAFormSubmissionHandlingToVitaminAHandler() throws Exception { FormSubmission formSubmission = create().withFormName("vitamin_a").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); ro...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateChildRegistrationOAFormSubmissionHandlingToChildRegistrationOAHandler() throws Exception { FormSubmission formSubmission = create().withFormName("child_registration_oa").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateDeliveryPlanFormSubmissionHandlingToDeliveryPlanHandler() throws Exception { FormSubmission formSubmission = create().withFormName("delivery_plan").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSub...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateECEditFormSubmissionHandlingToECEditHandler() throws Exception { FormSubmission formSubmission = create().withFormName("ec_edit").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).thenReturn(formSubmission); router.r...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void shouldDelegateANCInvestigationsFormSubmissionHandlingToANCInvestigationsHandler() throws Exception { FormSubmission formSubmission = create().withFormName("anc_investigations").withInstanceId("instance id 1").withVersion("122").build(); when(formDataRepository.fetchFromSubmission("instance id 1")).the...
public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: " + submission); } else ...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
FormSubmissionRouter { public void route(String instanceId) throws Exception { FormSubmission submission = formDataRepository.fetchFromSubmission(instanceId); FormSubmissionHandler handler = handlerMap.get(submission.formName()); if (handler == null) { logWarn("Could not find a handler due to unknown form submission: "...
@Test public void testFetchFailsGivenWrongUrl() { Response<String> resp = httpAgent.fetch("wrong.url"); Assert.assertEquals(ResponseStatus.failure, resp.status()); }
public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return processResponse(u...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
@Test public void testFetchPassesGivenCorrectUrl() { PowerMockito.mockStatic(Base64.class); Response<String> resp = httpAgent.fetch("https: Assert.assertEquals(ResponseStatus.success, resp.status()); }
public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return processResponse(u...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
HTTPAgent { public Response<String> fetch(String requestURLPath) { try { HttpURLConnection urlConnection = initializeHttp(requestURLPath, true); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = initializeHttp(requestURLPath, true); } return proce...
@Test public void shouldReplaceUnderscoreWithSpace() throws Exception { org.junit.Assert.assertEquals("Abc def", org.smartregister.util.StringUtil.humanize("abc_def")); org.junit.Assert.assertEquals("Abc def", org.smartregister.util.StringUtil.humanize("Abc_def")); }
public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharacter); static String replaceAndHumanizeWithInitCapText(String value, S...
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharacter); static String replaceAndHumanizeWithInitCapText(String value, S...
@Test public void testPostFailsGivenWrongUrl() { HashMap<String, String> map = new HashMap<>(); map.put("title", "OpenSRP Testing Tuesdays"); JSONObject jObject = new JSONObject(map); Response<String> resp = httpAgent.post("wrong.url", jObject.toString()); Assert.assertEquals(ResponseStatus.failure, resp.status()); }
public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePostRequest(post...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
@Test public void testPostPassesGivenCorrectUrl() { PowerMockito.mockStatic(Base64.class); HashMap<String, String> map = new HashMap<>(); map.put("title", "OpenSRP Testing Tuesdays"); JSONObject jObject = new JSONObject(map); Response<String> resp = httpAgent.post("http: Assert.assertEquals(ResponseStatus.success, resp...
public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePostRequest(post...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
HTTPAgent { public Response<String> post(String postURLPath, String jsonPayload) { HttpURLConnection urlConnection; try { urlConnection = generatePostRequest(postURLPath, jsonPayload); if (HttpStatus.SC_UNAUTHORIZED == urlConnection.getResponseCode()) { invalidateExpiredCachedAccessToken(); urlConnection = generatePost...
@Test public void testUrlCanBeAccessWithGivenCredentials() { PowerMockito.mockStatic(Base64.class); LoginResponse resp = httpAgent.urlCanBeAccessWithGivenCredentials("http: Assert.assertEquals(LoginResponse.SUCCESS.message(), resp.message()); }
public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] credentials = Se...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
@Test public void testUrlCanBeAccessWithGivenCredentialsGivenWrongUrl() { PowerMockito.mockStatic(Base64.class); LoginResponse resp = httpAgent.urlCanBeAccessWithGivenCredentials("wrong.url", "", "".toCharArray()); Assert.assertEquals(LoginResponse.MALFORMED_URL.message(), resp.message()); }
public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] credentials = Se...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
@Test public void testUrlCanBeAccessWithGivenCredentialsGivenEmptyResp() { PowerMockito.mockStatic(Base64.class); LoginResponse resp = httpAgent.urlCanBeAccessWithGivenCredentials("http: Assert.assertEquals(LoginResponse.SUCCESS_WITH_EMPTY_RESPONSE.message(), resp.message()); }
public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] credentials = Se...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
HTTPAgent { public LoginResponse urlCanBeAccessWithGivenCredentials(String requestURL, String userName, char[] password) { LoginResponse loginResponse = null; HttpURLConnection urlConnection = null; String url = null; try { url = requestURL.replaceAll("\\s+", ""); urlConnection = initializeHttp(url, false); byte[] cred...
@Test public void testfetchWithCredentialsFailsGivenWrongUrl() { Response<String> resp = httpAgent.fetchWithCredentials("wrong.url", SAMPLE_TEST_TOKEN); Assert.assertEquals(ResponseStatus.failure, resp.status()); }
public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARER + " ").app...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
@Test public void testfetchWithCredentialsPassesGivenCorrectUrl() { PowerMockito.mockStatic(Base64.class); Response<String> resp = httpAgent.fetchWithCredentials("https: Assert.assertEquals(ResponseStatus.success, resp.status()); }
public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARER + " ").app...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
HTTPAgent { public Response<String> fetchWithCredentials(String requestURL, String accessToken) { try { HttpURLConnection urlConnection = initializeHttp(requestURL, false); urlConnection.setRequestProperty(AllConstants.HTTP_REQUEST_HEADERS.AUTHORIZATION, new StringBuilder(AllConstants.HTTP_REQUEST_AUTH_TOKEN_TYPE.BEARE...
@Test public void testHttpImagePostGivenWrongUrl() { String resp = httpAgent.httpImagePost("wrong.url", profileImage); Assert.assertEquals("", resp); }
public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection.setUseCaches...
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
@Test public void testHttpImagePostTimeout() { PowerMockito.mockStatic(Base64.class); PowerMockito.mockStatic(File.class); PowerMockito.mockStatic(FileInputStream.class); ProfileImage profileImage2 = new ProfileImage(); profileImage2.setFilepath("test"); String resp = httpAgent.httpImagePost("http: Assert.assertEquals(...
public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection.setUseCaches...
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
HTTPAgent { public String httpImagePost(String urlString, ProfileImage image) { OutputStream outputStream; PrintWriter writer; String responseString = ""; HttpURLConnection httpUrlConnection = null; try { httpUrlConnection = initializeHttp(urlString, true); httpUrlConnection.setRequestMethod("POST"); httpUrlConnection....
@Test public void testPostWithJsonResponse() { PowerMockito.mockStatic(Base64.class); HashMap<String, String> map = new HashMap<>(); map.put("title", "OpenSRP Testing Tuesdays"); JSONObject jObject = new JSONObject(map); Response<String> resp = httpAgent.postWithJsonResponse("http: Assert.assertEquals(ResponseStatus.su...
public Response<String> postWithJsonResponse(String postURLPath, String jsonPayload) { logResponse(postURLPath, jsonPayload); return post(postURLPath, jsonPayload); }
HTTPAgent { public Response<String> postWithJsonResponse(String postURLPath, String jsonPayload) { logResponse(postURLPath, jsonPayload); return post(postURLPath, jsonPayload); } }
HTTPAgent { public Response<String> postWithJsonResponse(String postURLPath, String jsonPayload) { logResponse(postURLPath, jsonPayload); return post(postURLPath, jsonPayload); } HTTPAgent(Context context, AllSharedPreferences allSharedPreferences, DristhiConfiguration configuration); }
HTTPAgent { public Response<String> postWithJsonResponse(String postURLPath, String jsonPayload) { logResponse(postURLPath, jsonPayload); return post(postURLPath, jsonPayload); } HTTPAgent(Context context, AllSharedPreferences allSharedPreferences, DristhiConfiguration configuration); Response<String> fetch...
HTTPAgent { public Response<String> postWithJsonResponse(String postURLPath, String jsonPayload) { logResponse(postURLPath, jsonPayload); return post(postURLPath, jsonPayload); } HTTPAgent(Context context, AllSharedPreferences allSharedPreferences, DristhiConfiguration configuration); Response<String> fetch...
@Test public void assertShouldHandleEmptyAndNull() throws Exception { org.junit.Assert.assertEquals("", org.smartregister.util.StringUtil.humanize("")); }
public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } }
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharacter); static String replaceAndHumanizeWithInitCapText(String value, S...
StringUtil { public static String humanize(String value) { return capitalize(replace(getValue(value), "_", " ")); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharacter); static String replaceAndHumanizeWithInitCapText(String value, S...
@Test public void testDownloadFromUrl() throws Exception { HTTPAgent httpAgentSpy = Mockito.spy(httpAgent); Mockito.doReturn(dirFile).when(httpAgentSpy).getSDCardDownloadPath(); Mockito.doReturn(file).when(httpAgentSpy).getFile(TEST_FILE_NAME, dirFile); Mockito.doReturn(false).when(dirFile).exists(); Mockito.doReturn(t...
public DownloadStatus downloadFromUrl(String url, String filename) { Response<DownloadStatus> status = downloadFromURL(url, filename); Timber.d("downloading file name : %s and url %s", filename, url); return status.payload(); }
HTTPAgent { public DownloadStatus downloadFromUrl(String url, String filename) { Response<DownloadStatus> status = downloadFromURL(url, filename); Timber.d("downloading file name : %s and url %s", filename, url); return status.payload(); } }
HTTPAgent { public DownloadStatus downloadFromUrl(String url, String filename) { Response<DownloadStatus> status = downloadFromURL(url, filename); Timber.d("downloading file name : %s and url %s", filename, url); return status.payload(); } HTTPAgent(Context context, AllSharedPreferences allSharedPreferences...
HTTPAgent { public DownloadStatus downloadFromUrl(String url, String filename) { Response<DownloadStatus> status = downloadFromURL(url, filename); Timber.d("downloading file name : %s and url %s", filename, url); return status.payload(); } HTTPAgent(Context context, AllSharedPreferences allSharedPreferences...
HTTPAgent { public DownloadStatus downloadFromUrl(String url, String filename) { Response<DownloadStatus> status = downloadFromURL(url, filename); Timber.d("downloading file name : %s and url %s", filename, url); return status.payload(); } HTTPAgent(Context context, AllSharedPreferences allSharedPreferences...
@Test public void shouldFetchAlertActions() throws Exception { Mockito.when(httpAgent.fetch(EXPECTED_URL)).thenReturn(new Response<String>(ResponseStatus.success, IOUtils.toString(getClass().getResource("/alerts.json")))); Response<List<Action>> actions = drishtiService.fetchNewActions("anm1", "0"); Mockito.verify(http...
public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionType = new TypeToken...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
@Test public void shouldFetchNoAlertActionsWhenJsonIsForEmptyList() throws Exception { Mockito.when(httpAgent.fetch(EXPECTED_URL)).thenReturn(new Response<String>(ResponseStatus.success, "[]")); Response<List<Action>> actions = drishtiService.fetchNewActions("anm1", "0"); Assert.assertTrue(actions.payload().isEmpty());...
public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionType = new TypeToken...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
@Test public void shouldFetchNoAlertActionsWhenHTTPCallFails() throws Exception { Mockito.when(httpAgent.fetch(EXPECTED_URL)).thenReturn(new Response<String>(ResponseStatus.failure, null)); Response<List<Action>> actions = drishtiService.fetchNewActions("anm1", "0"); Assert.assertTrue(actions.payload().isEmpty()); Asse...
public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionType = new TypeToken...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
@Test public void shouldURLEncodeTheANMIdentifierPartWhenItHasASpace() { String expectedURLWithSpaces = "http: Mockito.when(httpAgent.fetch(expectedURLWithSpaces)).thenReturn(new Response<String>(ResponseStatus.success, "[]")); drishtiService.fetchNewActions("ANM WITH SPACE", "0"); Mockito.verify(httpAgent).fetch(expec...
public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionType = new TypeToken...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
@Test public void shouldReturnFailureResponseWhenJsonIsMalformed() { String expectedURLWithSpaces = "http: Mockito.when(httpAgent.fetch(expectedURLWithSpaces)).thenReturn(new Response<String>(ResponseStatus.success, "[{\"anmIdentifier\": \"ANMX\", ")); Response<List<Action>> actions = drishtiService.fetchNewActions("AN...
public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionType = new TypeToken...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
DrishtiService { public Response<List<Action>> fetchNewActions(String anmIdentifier, String previouslyFetchedIndex) { String anmID = URLEncoder.encode(anmIdentifier); Response<String> response = agent .fetch(drishtiBaseURL + "/actions?anmIdentifier=" + anmID + "&timeStamp=" + previouslyFetchedIndex); Type collectionTyp...
@Test public void shouldDelegateProcessingToZiggyServiceAndMarkAsSynced() throws Exception { List<FormSubmission> submissions = Arrays.asList(FormSubmissionBuilder.create().withInstanceId("instance id 1").withVersion("122").build(), FormSubmissionBuilder.create().withInstanceId("instance id 2").withVersion("123").build...
public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); } catch (Exception e) { ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
@Test public void shouldNotDelegateProcessingToZiggyServiceForProcessedSubmissions() throws Exception { FormSubmission firstFormSubmission = FormSubmissionBuilder.create().withInstanceId("instance id 1").withVersion("122").build(); FormSubmission secondFormSubmission = FormSubmissionBuilder.create().withInstanceId("ins...
public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); } catch (Exception e) { ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
FormSubmissionService { public void processSubmissions(List<FormSubmission> formSubmissions) { for (FormSubmission submission : formSubmissions) { if (!formDataRepository.submissionExists(submission.instanceId())) { try { ziggyService.saveForm(getParams(submission), submission.instance()); updateFTSsearch(submission); ...
@Test public void testUpdateFTSSearchForIdField() { service = spy(service); Whitebox.setInternalState(service, "allCommonsRepositoryMap", allCommonsRepositoryMap); when(allCommonsRepositoryMap.get("bindtype1")).thenReturn(allCommonsRepository); FormSubmission formSubmission = mock(FormSubmission.class); FormData form =...
public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && field.name().equals("id"...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
@Test public void assertReplaceAndHumanizeCallsHumanize() throws Exception { org.junit.Assert.assertEquals("Abc def", StringUtil.replaceAndHumanize("abc def", " ", "_")); }
public static String replaceAndHumanize(String value, String oldCharacter, String newCharacter) { return humanize(replace(getValue(value), oldCharacter, newCharacter)); }
StringUtil { public static String replaceAndHumanize(String value, String oldCharacter, String newCharacter) { return humanize(replace(getValue(value), oldCharacter, newCharacter)); } }
StringUtil { public static String replaceAndHumanize(String value, String oldCharacter, String newCharacter) { return humanize(replace(getValue(value), oldCharacter, newCharacter)); } }
StringUtil { public static String replaceAndHumanize(String value, String oldCharacter, String newCharacter) { return humanize(replace(getValue(value), oldCharacter, newCharacter)); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharact...
StringUtil { public static String replaceAndHumanize(String value, String oldCharacter, String newCharacter) { return humanize(replace(getValue(value), oldCharacter, newCharacter)); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCharacter, String newCharact...
@Test public void testUpdateFTSSearchForInnerBindType() { service = spy(service); Whitebox.setInternalState(service, "allCommonsRepositoryMap", allCommonsRepositoryMap); when(allCommonsRepositoryMap.get("innerBindType")).thenReturn(allCommonsRepository); FormSubmission formSubmission = mock(FormSubmission.class); FormD...
public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && field.name().equals("id"...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
@Test public void testUpdateFTSSearchForSubForms() { String subFormBindType = "subBindType1"; String subFormEntityId = "subEntityId1"; Whitebox.setInternalState(service, "allCommonsRepositoryMap", allCommonsRepositoryMap); when(allCommonsRepositoryMap.get(subFormBindType)).thenReturn(allCommonsRepository); FormSubmissi...
public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && field.name().equals("id"...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
FormSubmissionService { public void updateFTSsearch(FormSubmission formSubmission) { if (allCommonsRepositoryMap == null || allCommonsRepositoryMap.isEmpty()) { return; } FormData form = formSubmission.getForm(); String bindType = form.getBind_type(); for (FormField field : form.fields()) { if (field.name() != null && ...
@Test public void shouldAddAnAlertIntoAlertRepositoryForMotherCreateAlertAction() throws Exception { Action actionForMother = ActionBuilder.actionForCreateAlert("Case X", AlertStatus.normal.value(), BeneficiaryType.mother.value(), "Schedule 1", "ANC 1", "2012-01-01", "2012-01-22", "0"); service.create(actionForMother);...
public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.createAlert(aler...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
@Test public void shouldAddAnAlertIntoAlertRepositoryForECCreateAlertAction() throws Exception { Action actionForEC = ActionBuilder.actionForCreateAlert("Case X", AlertStatus.normal.value(), BeneficiaryType.ec.value(), "Schedule 1", "Milestone 1", "2012-01-01", "2012-01-22", "0"); service.create(actionForEC); Mockito.v...
public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.createAlert(aler...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
@Test public void shouldAddAnAlertIntoAlertRepositoryForECCreateAlertActionWhenThereIsNoMother() throws Exception { Action actionForEC = ActionBuilder.actionForCreateAlert("Case X", AlertStatus.normal.value(), BeneficiaryType.ec.value(), "Schedule 1", "Milestone 1", "2012-01-01", "2012-01-22", "0"); service.create(acti...
public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.createAlert(aler...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
@Test public void shouldNotCreateIfActionIsInactive() throws Exception { Action actionForMother = new Action("Case X", "alert", "createAlert", new HashMap<String, String>(), "0", false, new HashMap<String, String>()); service.create(actionForMother); Mockito.verifyZeroInteractions(alertRepository); }
public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.createAlert(aler...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
@Test public void shouldAddAnAlertIntoAlertRepositoryForChildCreateAlertAction() throws Exception { Action actionForMother = ActionBuilder.actionForCreateAlert("Case X", AlertStatus.urgent.value(), BeneficiaryType.child.value(), "Schedule 1", "Milestone 1", "2012-01-01", "2012-01-22", "0"); service.create(actionForMoth...
public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.createAlert(aler...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
@Test public void shouldDeleteAllFromRepositoryForDeleteAllActions() throws Exception { Action firstAction = ActionBuilder.actionForDeleteAllAlert("Case X"); Action secondAction = ActionBuilder.actionForDeleteAllAlert("Case Y"); service.deleteAll(firstAction); service.deleteAll(secondAction); Mockito.verify(alertReposi...
public void deleteAll(Action action) { repository.deleteAllAlertsForEntity(action.caseID()); }
AlertService { public void deleteAll(Action action) { repository.deleteAllAlertsForEntity(action.caseID()); } }
AlertService { public void deleteAll(Action action) { repository.deleteAllAlertsForEntity(action.caseID()); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); }
AlertService { public void deleteAll(Action action) { repository.deleteAllAlertsForEntity(action.caseID()); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(Action ac...
AlertService { public void deleteAll(Action action) { repository.deleteAllAlertsForEntity(action.caseID()); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(Action ac...
@Test public void testConstructorWithAlertParam() { Alert alert = new Alert("Case X", "Schedule 1", "ANC 1", AlertStatus.normal, "2012-01-01", "2012-01-22"); service.create(alert); Mockito.verify(alertRepository).createAlert(alert); }
public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.createAlert(aler...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
AlertService { public void create(Action action) { if (action.isActionActive() == null || action.isActionActive()) { Alert alert = new Alert(action.caseID(), action.get("scheduleName"), action.get("visitCode"), AlertStatus.from(action.get("alertStatus")), action.get("startDate"), action.get("expiryDate")); repository.c...
@Test public void testFindEntityById() { service.findByEntityId("entity-id"); Mockito.verify(alertRepository).findByEntityId("entity-id"); }
public List<Alert> findByEntityId(String entityId) { return repository.findByEntityId(entityId); }
AlertService { public List<Alert> findByEntityId(String entityId) { return repository.findByEntityId(entityId); } }
AlertService { public List<Alert> findByEntityId(String entityId) { return repository.findByEntityId(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); }
AlertService { public List<Alert> findByEntityId(String entityId) { return repository.findByEntityId(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(Actio...
AlertService { public List<Alert> findByEntityId(String entityId) { return repository.findByEntityId(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(Actio...
@Test public void assertReplaceAndHumanizeWithInitCapTextCallsHumanize() throws Exception { org.junit.Assert.assertEquals("Abc def", StringUtil.replaceAndHumanizeWithInitCapText("abc def", " ", "_")); }
public static String replaceAndHumanizeWithInitCapText(String value, String oldCharacter, String newCharacter) { return humanize(WordUtils.capitalize(replace(getValue(value), oldCharacter, newCharacter))); }
StringUtil { public static String replaceAndHumanizeWithInitCapText(String value, String oldCharacter, String newCharacter) { return humanize(WordUtils.capitalize(replace(getValue(value), oldCharacter, newCharacter))); } }
StringUtil { public static String replaceAndHumanizeWithInitCapText(String value, String oldCharacter, String newCharacter) { return humanize(WordUtils.capitalize(replace(getValue(value), oldCharacter, newCharacter))); } }
StringUtil { public static String replaceAndHumanizeWithInitCapText(String value, String oldCharacter, String newCharacter) { return humanize(WordUtils.capitalize(replace(getValue(value), oldCharacter, newCharacter))); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCha...
StringUtil { public static String replaceAndHumanizeWithInitCapText(String value, String oldCharacter, String newCharacter) { return humanize(WordUtils.capitalize(replace(getValue(value), oldCharacter, newCharacter))); } static String humanize(String value); static String replaceAndHumanize(String value, String oldCha...
@Test public void testFindByEntityIdAndAlertNames() { service.findByEntityIdAndAlertNames("Entity 1", "AncAlert"); Mockito.verify(alertRepository).findByEntityIdAndAlertNames("Entity 1", "AncAlert"); }
public List<Alert> findByEntityIdAndAlertNames(String entityId, String... names) { return repository.findByEntityIdAndAlertNames(entityId, names); }
AlertService { public List<Alert> findByEntityIdAndAlertNames(String entityId, String... names) { return repository.findByEntityIdAndAlertNames(entityId, names); } }
AlertService { public List<Alert> findByEntityIdAndAlertNames(String entityId, String... names) { return repository.findByEntityIdAndAlertNames(entityId, names); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepos...
AlertService { public List<Alert> findByEntityIdAndAlertNames(String entityId, String... names) { return repository.findByEntityIdAndAlertNames(entityId, names); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepos...
AlertService { public List<Alert> findByEntityIdAndAlertNames(String entityId, String... names) { return repository.findByEntityIdAndAlertNames(entityId, names); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepos...
@Test public void testByEntityIdAndOffline() { service.findByEntityIdAndOffline("Entity 1", "PncAlert"); Mockito.verify(alertRepository).findOfflineByEntityIdAndName("Entity 1", "PncAlert"); }
public List<Alert> findByEntityIdAndOffline(String entityId, String... names) { return repository.findOfflineByEntityIdAndName(entityId, names); }
AlertService { public List<Alert> findByEntityIdAndOffline(String entityId, String... names) { return repository.findOfflineByEntityIdAndName(entityId, names); } }
AlertService { public List<Alert> findByEntityIdAndOffline(String entityId, String... names) { return repository.findOfflineByEntityIdAndName(entityId, names); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsReposit...
AlertService { public List<Alert> findByEntityIdAndOffline(String entityId, String... names) { return repository.findOfflineByEntityIdAndName(entityId, names); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsReposit...
AlertService { public List<Alert> findByEntityIdAndOffline(String entityId, String... names) { return repository.findOfflineByEntityIdAndName(entityId, names); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsReposit...
@Test public void testFindByEntityIdAndScheduleName() { service.findByEntityIdAndScheduleName("Entity 1", "Schedule 1"); Mockito.verify(alertRepository).findByEntityIdAndScheduleName("Entity 1", "Schedule 1"); }
public Alert findByEntityIdAndScheduleName(String entityId, String scheduleName) { return repository.findByEntityIdAndScheduleName(entityId, scheduleName); }
AlertService { public Alert findByEntityIdAndScheduleName(String entityId, String scheduleName) { return repository.findByEntityIdAndScheduleName(entityId, scheduleName); } }
AlertService { public Alert findByEntityIdAndScheduleName(String entityId, String scheduleName) { return repository.findByEntityIdAndScheduleName(entityId, scheduleName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCom...
AlertService { public Alert findByEntityIdAndScheduleName(String entityId, String scheduleName) { return repository.findByEntityIdAndScheduleName(entityId, scheduleName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCom...
AlertService { public Alert findByEntityIdAndScheduleName(String entityId, String scheduleName) { return repository.findByEntityIdAndScheduleName(entityId, scheduleName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCom...
@Test public void testChangeAlertStatusToInProcess() { service = spy(service); service.changeAlertStatusToInProcess("Entity 1", "AncAlert"); Mockito.verify(alertRepository).changeAlertStatusToInProcess("Entity 1", "AncAlert"); Mockito.verify(service).updateFtsSearchAfterStatusChange("Entity 1", "AncAlert"); }
public void changeAlertStatusToInProcess(String entityId, String alertName) { repository.changeAlertStatusToInProcess(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); }
AlertService { public void changeAlertStatusToInProcess(String entityId, String alertName) { repository.changeAlertStatusToInProcess(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } }
AlertService { public void changeAlertStatusToInProcess(String entityId, String alertName) { repository.changeAlertStatusToInProcess(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFt...
AlertService { public void changeAlertStatusToInProcess(String entityId, String alertName) { repository.changeAlertStatusToInProcess(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFt...
AlertService { public void changeAlertStatusToInProcess(String entityId, String alertName) { repository.changeAlertStatusToInProcess(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFt...
@Test public void testChangeAlertStatusToComplete() { service = spy(service); service.changeAlertStatusToComplete("Entity 1", "AncAlert"); Mockito.verify(alertRepository).changeAlertStatusToComplete("Entity 1", "AncAlert"); Mockito.verify(service).updateFtsSearchAfterStatusChange("Entity 1", "AncAlert"); }
public void changeAlertStatusToComplete(String entityId, String alertName) { repository.changeAlertStatusToComplete(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); }
AlertService { public void changeAlertStatusToComplete(String entityId, String alertName) { repository.changeAlertStatusToComplete(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } }
AlertService { public void changeAlertStatusToComplete(String entityId, String alertName) { repository.changeAlertStatusToComplete(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsO...
AlertService { public void changeAlertStatusToComplete(String entityId, String alertName) { repository.changeAlertStatusToComplete(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsO...
AlertService { public void changeAlertStatusToComplete(String entityId, String alertName) { repository.changeAlertStatusToComplete(entityId, alertName); updateFtsSearchAfterStatusChange(entityId, alertName); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsO...
@Test public void testDeleteAlert() { service.deleteAlert("Entity 1", "Visit 1"); Mockito.verify(alertRepository).deleteVaccineAlertForEntity("Entity 1", "Visit 1"); }
public void deleteAlert(String entityId, String visitCode) { repository.deleteVaccineAlertForEntity(entityId, visitCode); }
AlertService { public void deleteAlert(String entityId, String visitCode) { repository.deleteVaccineAlertForEntity(entityId, visitCode); } }
AlertService { public void deleteAlert(String entityId, String visitCode) { repository.deleteVaccineAlertForEntity(entityId, visitCode); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsReposito...
AlertService { public void deleteAlert(String entityId, String visitCode) { repository.deleteVaccineAlertForEntity(entityId, visitCode); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsReposito...
AlertService { public void deleteAlert(String entityId, String visitCode) { repository.deleteVaccineAlertForEntity(entityId, visitCode); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsReposito...
@Test public void testDeleteOfflineAlerts() { service.deleteOfflineAlerts("Entity 1"); Mockito.verify(alertRepository).deleteOfflineAlertsForEntity("Entity 1"); }
public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); }
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } }
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); }
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(...
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(...
@Test public void testDeleteOfflineAlertsWithNames() { service.deleteOfflineAlerts("Entity 1", "AncAlert"); Mockito.verify(alertRepository).deleteOfflineAlertsForEntity("Entity 1", "AncAlert"); }
public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); }
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } }
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); }
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(...
AlertService { public void deleteOfflineAlerts(String entityId) { repository.deleteOfflineAlertsForEntity(entityId); } AlertService(AlertRepository repository); AlertService(AlertRepository repository, CommonFtsObject commonFtsObject, Map<String, AllCommonsRepository> allCommonsRepositoryMap); void create(...
@Test public void testUpdateFtsSearchAfterStatusChange() { service = spy(service); Alert alert = new Alert("Case X", "Schedule 1", "ANC 1", AlertStatus.normal, "2012-01-01", "2012-01-22"); when(service.findByEntityIdAndAlertNames("Entity 1", "AncAlert")).thenReturn(Collections.singletonList(alert)); service.updateFtsSe...
public void updateFtsSearchAfterStatusChange(String entityId, String alertName) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { List<Alert> alerts = findByEntityIdAndAlertNames(entityId, alertName); if (alerts != null && !alerts.isEmpty()) { for (Alert alert : alerts) { updateFtsSearch(alert, ...
AlertService { public void updateFtsSearchAfterStatusChange(String entityId, String alertName) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { List<Alert> alerts = findByEntityIdAndAlertNames(entityId, alertName); if (alerts != null && !alerts.isEmpty()) { for (Alert alert : alerts) { updateFt...
AlertService { public void updateFtsSearchAfterStatusChange(String entityId, String alertName) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { List<Alert> alerts = findByEntityIdAndAlertNames(entityId, alertName); if (alerts != null && !alerts.isEmpty()) { for (Alert alert : alerts) { updateFt...
AlertService { public void updateFtsSearchAfterStatusChange(String entityId, String alertName) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { List<Alert> alerts = findByEntityIdAndAlertNames(entityId, alertName); if (alerts != null && !alerts.isEmpty()) { for (Alert alert : alerts) { updateFt...
AlertService { public void updateFtsSearchAfterStatusChange(String entityId, String alertName) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { List<Alert> alerts = findByEntityIdAndAlertNames(entityId, alertName); if (alerts != null && !alerts.isEmpty()) { for (Alert alert : alerts) { updateFt...
@Test public void testUpdateFtsSearchInACR() { AllCommonsRepository allCommonsRepository = mock(AllCommonsRepository.class); when(allCommonsRepositoryMap.get("bind 1")).thenReturn(allCommonsRepository); String[] alertFilterVisitCodes = new String[] {"AncFilter"}; when(commonFtsObject.getAlertFilterVisitCodes()).thenRet...
public boolean updateFtsSearchInACR(String bindType, String entityId, String field, String value) { AllCommonsRepository allCommonsRepository = getAllCommonRepository(bindType); if (allCommonsRepository != null) { return allCommonsRepository.updateSearch(entityId, field, value, commonFtsObject.getAlertFilterVisitCodes(...
AlertService { public boolean updateFtsSearchInACR(String bindType, String entityId, String field, String value) { AllCommonsRepository allCommonsRepository = getAllCommonRepository(bindType); if (allCommonsRepository != null) { return allCommonsRepository.updateSearch(entityId, field, value, commonFtsObject.getAlertFi...
AlertService { public boolean updateFtsSearchInACR(String bindType, String entityId, String field, String value) { AllCommonsRepository allCommonsRepository = getAllCommonRepository(bindType); if (allCommonsRepository != null) { return allCommonsRepository.updateSearch(entityId, field, value, commonFtsObject.getAlertFi...
AlertService { public boolean updateFtsSearchInACR(String bindType, String entityId, String field, String value) { AllCommonsRepository allCommonsRepository = getAllCommonRepository(bindType); if (allCommonsRepository != null) { return allCommonsRepository.updateSearch(entityId, field, value, commonFtsObject.getAlertFi...
AlertService { public boolean updateFtsSearchInACR(String bindType, String entityId, String field, String value) { AllCommonsRepository allCommonsRepository = getAllCommonRepository(bindType); if (allCommonsRepository != null) { return allCommonsRepository.updateSearch(entityId, field, value, commonFtsObject.getAlertFi...
@Test public void assertHumanizeAndUppercase() throws Exception { org.junit.Assert.assertEquals("ABC DEF", StringUtil.humanizeAndUppercase("abc def", " ")); }
public static String humanizeAndUppercase(String value, String... skipTokens) { String res = humanizeAndDoUPPERCASE(value); for (String s : skipTokens) { res = res.replaceAll("(?i)" + s, s); } return res; }
StringUtil { public static String humanizeAndUppercase(String value, String... skipTokens) { String res = humanizeAndDoUPPERCASE(value); for (String s : skipTokens) { res = res.replaceAll("(?i)" + s, s); } return res; } }
StringUtil { public static String humanizeAndUppercase(String value, String... skipTokens) { String res = humanizeAndDoUPPERCASE(value); for (String s : skipTokens) { res = res.replaceAll("(?i)" + s, s); } return res; } }
StringUtil { public static String humanizeAndUppercase(String value, String... skipTokens) { String res = humanizeAndDoUPPERCASE(value); for (String s : skipTokens) { res = res.replaceAll("(?i)" + s, s); } return res; } static String humanize(String value); static String replaceAndHumanize(String value, String oldChar...
StringUtil { public static String humanizeAndUppercase(String value, String... skipTokens) { String res = humanizeAndDoUPPERCASE(value); for (String s : skipTokens) { res = res.replaceAll("(?i)" + s, s); } return res; } static String humanize(String value); static String replaceAndHumanize(String value, String oldChar...
@Test public void testUpdateFtsSearch() { service = spy(service); Alert alert = new Alert("Case X", "Schedule 1", "ANC 1", AlertStatus.normal, "2012-01-01", "2012-01-22"); when(commonFtsObject.getAlertBindType("Schedule 1")).thenReturn("AncBindType"); when(commonFtsObject.alertUpdateVisitCode("Schedule 1")).thenReturn(...
public void updateFtsSearch(Alert alert, boolean statusChange) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { String entityId = alert.caseId(); String scheduleName = alert.scheduleName(); String visitCode = alert.visitCode(); AlertStatus status = alert.status(); String bindType = commonFtsObj...
AlertService { public void updateFtsSearch(Alert alert, boolean statusChange) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { String entityId = alert.caseId(); String scheduleName = alert.scheduleName(); String visitCode = alert.visitCode(); AlertStatus status = alert.status(); String bindType...
AlertService { public void updateFtsSearch(Alert alert, boolean statusChange) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { String entityId = alert.caseId(); String scheduleName = alert.scheduleName(); String visitCode = alert.visitCode(); AlertStatus status = alert.status(); String bindType...
AlertService { public void updateFtsSearch(Alert alert, boolean statusChange) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { String entityId = alert.caseId(); String scheduleName = alert.scheduleName(); String visitCode = alert.visitCode(); AlertStatus status = alert.status(); String bindType...
AlertService { public void updateFtsSearch(Alert alert, boolean statusChange) { try { if (commonFtsObject != null && allCommonsRepositoryMap != null) { String entityId = alert.caseId(); String scheduleName = alert.scheduleName(); String visitCode = alert.visitCode(); AlertStatus status = alert.status(); String bindType...
@Test public void shouldPushPendingFormSubmissionsToServerAndMarkThemAsSynced() throws Exception { Mockito.when(httpAgent.post("http: .thenReturn(new Response<String>(ResponseStatus.success, null)); service.pushToServer(); Mockito.inOrder(allSettings, httpAgent, repository); Mockito.verify(allSharedPreferences).fetchRe...
public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(format("{0}/{1}", configuration.d...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
@Test public void shouldNotMarkPendingSubmissionsAsSyncedIfPostFails() throws Exception { Mockito.when(httpAgent.post("http: .thenReturn(new Response<String>(ResponseStatus.failure, null)); service.pushToServer(); Mockito.verify(repository).getPendingFormSubmissions(); Mockito.verifyNoMoreInteractions(repository); }
public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(format("{0}/{1}", configuration.d...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
@Test public void shouldNotPushIfThereAreNoPendingSubmissions() throws Exception { Mockito.when(repository.getPendingFormSubmissions()).thenReturn(Collections.<FormSubmission>emptyList()); service.pushToServer(); Mockito.verify(repository).getPendingFormSubmissions(); Mockito.verifyNoMoreInteractions(repository); Mocki...
public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(format("{0}/{1}", configuration.d...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
FormSubmissionSyncService { public void pushToServer() { List<FormSubmission> pendingFormSubmissions = formDataRepository .getPendingFormSubmissions(); if (pendingFormSubmissions.isEmpty()) { return; } String jsonPayload = mapToFormSubmissionDTO(pendingFormSubmissions); Response<String> response = httpAgent .post(forma...
@Test public void shouldPullFormSubmissionsFromServerInBatchesAndDelegateToProcessing() throws Exception { this.expectedFormSubmissionsDto = Arrays.asList(new FormSubmissionDTO( "anm id 1", "id 1", "entity id 1", "form name", formInstanceJSON, "123", "1")); List<FormSubmission> expectedFormSubmissions = Arrays.asList(n...
public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}?anm-id={2}&timestamp={3}&ba...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
@Test public void shouldReturnNothingFetchedStatusWhenNoFormSubmissionsAreGotFromServer() throws Exception { Mockito.when(configuration.syncDownloadBatchSize()).thenReturn(1); Mockito.when(allSettings.fetchPreviousFormSyncIndex()).thenReturn("122"); Mockito.when(httpAgent.fetch("http: .thenReturn(new Response<String>(R...
public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}?anm-id={2}&timestamp={3}&ba...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
@Test public void shouldNotDelegateToProcessingIfPullFails() throws Exception { Mockito.when(configuration.syncDownloadBatchSize()).thenReturn(1); Mockito.when(allSettings.fetchPreviousFormSyncIndex()).thenReturn("122"); Mockito.when(httpAgent.fetch("http: .thenReturn(new Response<String>(ResponseStatus.failure, null))...
public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}?anm-id={2}&timestamp={3}&ba...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
FormSubmissionSyncService { public FetchStatus pullFromServer() { FetchStatus dataStatus = nothingFetched; String anmId = allSharedPreferences.fetchRegisteredANM(); int downloadBatchSize = configuration.syncDownloadBatchSize(); String baseURL = configuration.dristhiBaseURL(); while (true) { String uri = format("{0}/{1}...
@Test public void shouldGetANMLocation() { when(configuration.dristhiBaseURL()).thenReturn("http: userService.getLocationInformation(); verify(httpAgent).fetch("http: }
public Response<String> getLocationInformation() { String requestURL = configuration.dristhiBaseURL() + OPENSRP_LOCATION_URL_PATH; return httpAgent.fetch(requestURL); }
UserService { public Response<String> getLocationInformation() { String requestURL = configuration.dristhiBaseURL() + OPENSRP_LOCATION_URL_PATH; return httpAgent.fetch(requestURL); } }
UserService { public Response<String> getLocationInformation() { String requestURL = configuration.dristhiBaseURL() + OPENSRP_LOCATION_URL_PATH; return httpAgent.fetch(requestURL); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session session...
UserService { public Response<String> getLocationInformation() { String requestURL = configuration.dristhiBaseURL() + OPENSRP_LOCATION_URL_PATH; return httpAgent.fetch(requestURL); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session session...
UserService { public Response<String> getLocationInformation() { String requestURL = configuration.dristhiBaseURL() + OPENSRP_LOCATION_URL_PATH; return httpAgent.fetch(requestURL); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session session...
@Test public void shouldSaveUserInformationRemoteLoginIsSuccessful() { org.smartregister.domain.jsonmapping.User user = new org.smartregister.domain.jsonmapping.User(); user.setPreferredName("Test"); userService.saveUserInfo(user); String userInfoString = AssetHandler.javaToJsonString(user); verify(saveUserInfoTask).sa...
public void saveUserInfo(User user) { try { if (user != null && user.getPreferredName() != null) { String preferredName = user.getPreferredName(); String userName = user.getUsername(); allSharedPreferences.updateANMPreferredName(userName, preferredName); } } catch (Exception e) { Timber.e(e); } String userInfoString = ...
UserService { public void saveUserInfo(User user) { try { if (user != null && user.getPreferredName() != null) { String preferredName = user.getPreferredName(); String userName = user.getUsername(); allSharedPreferences.updateANMPreferredName(userName, preferredName); } } catch (Exception e) { Timber.e(e); } String use...
UserService { public void saveUserInfo(User user) { try { if (user != null && user.getPreferredName() != null) { String preferredName = user.getPreferredName(); String userName = user.getUsername(); allSharedPreferences.updateANMPreferredName(userName, preferredName); } } catch (Exception e) { Timber.e(e); } String use...
UserService { public void saveUserInfo(User user) { try { if (user != null && user.getPreferredName() != null) { String preferredName = user.getPreferredName(); String userName = user.getUsername(); allSharedPreferences.updateANMPreferredName(userName, preferredName); } } catch (Exception e) { Timber.e(e); } String use...
UserService { public void saveUserInfo(User user) { try { if (user != null && user.getPreferredName() != null) { String preferredName = user.getPreferredName(); String userName = user.getUsername(); allSharedPreferences.updateANMPreferredName(userName, preferredName); } } catch (Exception e) { Timber.e(e); } String use...
@Test public void shouldSaveANMLocation() { org.smartregister.domain.jsonmapping.util.LocationTree locationTree = new org.smartregister.domain.jsonmapping.util.LocationTree(); org.smartregister.domain.jsonmapping.Location location = new org.smartregister.domain.jsonmapping.Location(); location.setName("test location");...
public void saveAnmLocation(LocationTree anmLocation) { String amnLocationString = AssetHandler.javaToJsonString(anmLocation); saveANMLocationTask.save(amnLocationString); }
UserService { public void saveAnmLocation(LocationTree anmLocation) { String amnLocationString = AssetHandler.javaToJsonString(anmLocation); saveANMLocationTask.save(amnLocationString); } }
UserService { public void saveAnmLocation(LocationTree anmLocation) { String amnLocationString = AssetHandler.javaToJsonString(anmLocation); saveANMLocationTask.save(amnLocationString); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session se...
UserService { public void saveAnmLocation(LocationTree anmLocation) { String amnLocationString = AssetHandler.javaToJsonString(anmLocation); saveANMLocationTask.save(amnLocationString); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session se...
UserService { public void saveAnmLocation(LocationTree anmLocation) { String amnLocationString = AssetHandler.javaToJsonString(anmLocation); saveANMLocationTask.save(amnLocationString); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session se...
@Test public void testCreateEventAndClients() throws IOException { when(database.rawQuery(query, params)).thenReturn(getECCursor()); when(clientProcessor.getColumnMappings(tableName)).thenReturn(getEcConfig()); Pair<List<Event>, List<Client>> eventsAndClients = recreateECUtil.createEventAndClients(database, tableName, ...
public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> events = new ArrayLis...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
@Test public void shouldConsiderALocalLoginValid() { when(allSharedPreferences.fetchRegisteredANM()).thenReturn("ANM X"); when(repository.canUseThisPassword(password)).thenReturn(true); assertTrue(userService.isValidLocalLogin("ANM X", password)); verify(allSharedPreferences).fetchRegisteredANM(); verify(repository).ca...
public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); }
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } }
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
@Test public void shouldConsiderALocalLoginInvalidWhenRegisteredUserDoesNotMatch() { when(allSharedPreferences.fetchRegisteredANM()).thenReturn("ANM X"); assertFalse(userService.isValidLocalLogin("SOME OTHER ANM", "password".getBytes())); verify(allSharedPreferences).fetchRegisteredANM(); verifyZeroInteractions(reposit...
public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); }
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } }
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
@Test public void shouldConsiderALocalLoginInvalidWhenRegisteredUserMatchesButNotThePassword() { when(allSharedPreferences.fetchRegisteredANM()).thenReturn("ANM X"); when(repository.canUseThisPassword(password)).thenReturn(false); assertFalse(userService.isValidLocalLogin("ANM X", password)); verify(allSharedPreference...
public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); }
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } }
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
UserService { public boolean isValidLocalLogin(String userName, byte[] password) { return allSharedPreferences.fetchRegisteredANM().equals(userName) && DrishtiApplication.getInstance().getRepository() .canUseThisPassword(password) && !allSharedPreferences.fetchForceRemoteLogin(userName); } UserService(AllSettings allSe...
@Test public void shouldDeleteDataAndSettingsWhenLogoutHappens() throws Exception { SyncConfiguration syncConfiguration = mock(SyncConfiguration.class); Mockito.doReturn(false).when(syncConfiguration).clearDataOnNewTeamLogin(); ReflectionHelpers.setField(CoreLibrary.getInstance(), "syncConfiguration", syncConfiguration...
public void logout() { logoutSession(); allSettings.registerANM(""); allSettings.savePreviousFetchIndex("0"); configuration.getDrishtiApplication().getRepository().deleteRepository(); }
UserService { public void logout() { logoutSession(); allSettings.registerANM(""); allSettings.savePreviousFetchIndex("0"); configuration.getDrishtiApplication().getRepository().deleteRepository(); } }
UserService { public void logout() { logoutSession(); allSettings.registerANM(""); allSettings.savePreviousFetchIndex("0"); configuration.getDrishtiApplication().getRepository().deleteRepository(); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg...
UserService { public void logout() { logoutSession(); allSettings.registerANM(""); allSettings.savePreviousFetchIndex("0"); configuration.getDrishtiApplication().getRepository().deleteRepository(); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg...
UserService { public void logout() { logoutSession(); allSettings.registerANM(""); allSettings.savePreviousFetchIndex("0"); configuration.getDrishtiApplication().getRepository().deleteRepository(); } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg...
@Test public void shouldSwitchLanguageToKannada() throws Exception { when(allSharedPreferences.fetchLanguagePreference()).thenReturn(ENGLISH_LOCALE); userService.switchLanguagePreference(); verify(allSharedPreferences).saveLanguagePreference(KANNADA_LOCALE); }
public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLISH_LOCALE); re...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
@Test public void shouldSwitchLanguageToEnglish() throws Exception { when(allSharedPreferences.fetchLanguagePreference()).thenReturn(KANNADA_LOCALE); userService.switchLanguagePreference(); verify(allSharedPreferences).saveLanguagePreference(ENGLISH_LOCALE); }
public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLISH_LOCALE); re...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
UserService { public String switchLanguagePreference() { String preferredLocale = allSharedPreferences.fetchLanguagePreference(); if (ENGLISH_LOCALE.equals(preferredLocale)) { allSharedPreferences.saveLanguagePreference(KANNADA_LOCALE); return KANNADA_LANGUAGE; } else { allSharedPreferences.saveLanguagePreference(ENGLI...
@Test public void shouldGetUserDataFromJSON() throws Exception { org.smartregister.domain.jsonmapping.User user = userService.getUserData(loginResponseData); assertNotNull(user); assertEquals("demotest", user.getUsername()); assertEquals("Demo test User", user.getPreferredName()); }
public User getUserData(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.user; } } catch (Exception e) { Timber.e(e); } return null; }
UserService { public User getUserData(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.user; } } catch (Exception e) { Timber.e(e); } return null; } }
UserService { public User getUserData(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.user; } } catch (Exception e) { Timber.e(e); } return null; } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session sessionArg, ...
UserService { public User getUserData(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.user; } } catch (Exception e) { Timber.e(e); } return null; } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session sessionArg, ...
UserService { public User getUserData(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.user; } } catch (Exception e) { Timber.e(e); } return null; } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Session sessionArg, ...
@Test public void shouldGetUserLocationFromJSON() throws Exception { org.smartregister.domain.jsonmapping.util.LocationTree locationTree = userService.getUserLocation(loginResponseData); LinkedHashMap<String, org.smartregister.domain.jsonmapping.util.TreeNode<String, org.smartregister.domain.jsonmapping.Location>> mapL...
public LocationTree getUserLocation(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.locations; } } catch (Exception e) { Timber.e(e); } return null; }
UserService { public LocationTree getUserLocation(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.locations; } } catch (Exception e) { Timber.e(e); } return null; } }
UserService { public LocationTree getUserLocation(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.locations; } } catch (Exception e) { Timber.e(e); } return null; } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Sessi...
UserService { public LocationTree getUserLocation(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.locations; } } catch (Exception e) { Timber.e(e); } return null; } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Sessi...
UserService { public LocationTree getUserLocation(LoginResponseData userInfo) { try { if (userInfo != null) { return userInfo.locations; } } catch (Exception e) { Timber.e(e); } return null; } UserService(AllSettings allSettingsArg, AllSharedPreferences allSharedPreferencesArg, HTTPAgent httpAgentArg, Sessi...
@Test public void testGetServerTimeZoneForExtractsTimeZoneFromResponse() { loginResponseData = mock(LoginResponseData.class); loginResponseData.time = new Time(new Date(), TimeZone.getTimeZone("Africa/Nairobi")); TimeZone timezone = UserService.getServerTimeZone(loginResponseData); assertNotNull(timezone); long millise...
public static TimeZone getServerTimeZone(LoginResponseData userInfo) { if (userInfo != null) { try { Time time = userInfo.time; if (time != null) { TimeZone timeZone = TimeZone.getTimeZone(time.getTimeZone()); return timeZone; } } catch (Exception e) { Timber.e(e); } } return null; }
UserService { public static TimeZone getServerTimeZone(LoginResponseData userInfo) { if (userInfo != null) { try { Time time = userInfo.time; if (time != null) { TimeZone timeZone = TimeZone.getTimeZone(time.getTimeZone()); return timeZone; } } catch (Exception e) { Timber.e(e); } } return null; } }
UserService { public static TimeZone getServerTimeZone(LoginResponseData userInfo) { if (userInfo != null) { try { Time time = userInfo.time; if (time != null) { TimeZone timeZone = TimeZone.getTimeZone(time.getTimeZone()); return timeZone; } } catch (Exception e) { Timber.e(e); } } return null; } UserService(AllSettin...
UserService { public static TimeZone getServerTimeZone(LoginResponseData userInfo) { if (userInfo != null) { try { Time time = userInfo.time; if (time != null) { TimeZone timeZone = TimeZone.getTimeZone(time.getTimeZone()); return timeZone; } } catch (Exception e) { Timber.e(e); } } return null; } UserService(AllSettin...
UserService { public static TimeZone getServerTimeZone(LoginResponseData userInfo) { if (userInfo != null) { try { Time time = userInfo.time; if (time != null) { TimeZone timeZone = TimeZone.getTimeZone(time.getTimeZone()); return timeZone; } } catch (Exception e) { Timber.e(e); } } return null; } UserService(AllSettin...
@Test public void testValidateDeviceTimeForNullServerTimeZoneReturnsError() { loginResponseData = mock(LoginResponseData.class); assertEquals(TimeStatus.ERROR, userService.validateDeviceTime(loginResponseData, 3600)); }
public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && deviceTimeZone !=...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
@Test public void testCreateEventAndClientsForMissingTable() { when(clientProcessor.getColumnMappings(tableName)).thenReturn(null); Pair<List<Event>, List<Client>> eventsAndClients = recreateECUtil.createEventAndClients(database, tableName, query, params, "FamilyRegistration", "Family", formTag); assertNull(eventsAndCl...
public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> events = new ArrayLis...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
RecreateECUtil { public Pair<List<Event>, List<Client>> createEventAndClients(SQLiteDatabase database, String tablename, String query, String[] params, String eventType, String entityType, FormTag formTag) { Table table = clientProcessor.getColumnMappings(tablename); if (table == null) { return null; } List<Event> even...
@Test public void testValidateDeviceTimeForDifferentTimeZoneServerTimeZoneReturnsMismatch() { loginResponseData = mock(LoginResponseData.class); loginResponseData.time = new Time(new Date(), TimeZone.getTimeZone("Africa/Nairobi")); TimeZone.setDefault(TimeZone.getTimeZone("GMT")); assertEquals(TimeStatus.TIMEZONE_MISMA...
public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && deviceTimeZone !=...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
@Test public void testValidateDeviceTimeForDifferentTimeReturnsMismatch() { loginResponseData = mock(LoginResponseData.class); Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MINUTE, -30); loginResponseData.time = new Time(calendar.getTime(), TimeZone.getTimeZone("Africa/Nairobi")); TimeZone.setDefaul...
public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && deviceTimeZone !=...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
@Test public void testValidateDeviceTimeSameTimeTimeAndTimeZone() { loginResponseData = mock(LoginResponseData.class); Calendar calendar = Calendar.getInstance(); loginResponseData.time = new Time(calendar.getTime(), TimeZone.getTimeZone("Africa/Nairobi")); TimeZone.setDefault(TimeZone.getTimeZone("Africa/Nairobi")); a...
public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && deviceTimeZone !=...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
UserService { public TimeStatus validateDeviceTime(LoginResponseData userInfo, long serverTimeThreshold) { TimeZone serverTimeZone = getServerTimeZone(userInfo); TimeZone deviceTimeZone = getDeviceTimeZone(); Date serverTime = getServerTime(userInfo); Date deviceTime = getDeviceTime(); if (serverTimeZone != null && dev...
@Test public void testValidateStoredServerTimeZoneForNullServerTimeZoneReturnsError() { when(allSharedPreferences.fetchServerTimeZone()).thenReturn(null); assertEquals(TimeStatus.ERROR, userService.validateStoredServerTimeZone()); verify(allSharedPreferences).saveForceRemoteLogin(true, userName); }
public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefault(); if (serv...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
@Test public void testValidateStoredServerTimeZoneForDifferentTimeZoneServerTimeZoneReturnsMismatch() { when(allSharedPreferences.fetchServerTimeZone()).thenReturn("Africa/Nairobi"); when(allSharedPreferences.fetchRegisteredANM()).thenReturn(userName); TimeZone.setDefault(TimeZone.getTimeZone("GMT")); assertEquals(Time...
public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefault(); if (serv...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
@Test public void testValidateStoredServerTimeZoneForSameTimeTimeAndTimeZone() { when(allSharedPreferences.fetchServerTimeZone()).thenReturn("Africa/Nairobi"); TimeZone.setDefault(TimeZone.getTimeZone("Africa/Nairobi")); assertEquals(TimeStatus.OK, userService.validateStoredServerTimeZone()); verify(allSharedPreference...
public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefault(); if (serv...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
UserService { public TimeStatus validateStoredServerTimeZone() { TimeStatus result = TimeStatus.ERROR; try { String serverTimeZoneId = allSharedPreferences.fetchServerTimeZone(); if (serverTimeZoneId != null) { TimeZone serverTimeZone = TimeZone.getTimeZone(serverTimeZoneId); TimeZone deviceTimeZone = TimeZone.getDefau...
@Test public void testIsUserInValidGroupForNullUserAndPassword() { assertFalse(userService.isUserInValidGroup(null, null)); }
public boolean isUserInValidGroup(final String userName, final char[] password) { if (keyStore != null && userName != null && password != null && !allSharedPreferences.fetchForceRemoteLogin(userName)) { byte[] storedHash = null; byte[] passwordHash = null; try { storedHash = getLocalAuthenticationCredentials(userName);...
UserService { public boolean isUserInValidGroup(final String userName, final char[] password) { if (keyStore != null && userName != null && password != null && !allSharedPreferences.fetchForceRemoteLogin(userName)) { byte[] storedHash = null; byte[] passwordHash = null; try { storedHash = getLocalAuthenticationCredenti...
UserService { public boolean isUserInValidGroup(final String userName, final char[] password) { if (keyStore != null && userName != null && password != null && !allSharedPreferences.fetchForceRemoteLogin(userName)) { byte[] storedHash = null; byte[] passwordHash = null; try { storedHash = getLocalAuthenticationCredenti...
UserService { public boolean isUserInValidGroup(final String userName, final char[] password) { if (keyStore != null && userName != null && password != null && !allSharedPreferences.fetchForceRemoteLogin(userName)) { byte[] storedHash = null; byte[] passwordHash = null; try { storedHash = getLocalAuthenticationCredenti...
UserService { public boolean isUserInValidGroup(final String userName, final char[] password) { if (keyStore != null && userName != null && password != null && !allSharedPreferences.fetchForceRemoteLogin(userName)) { byte[] storedHash = null; byte[] passwordHash = null; try { storedHash = getLocalAuthenticationCredenti...