@Test public void shouldFormBeSentFunction_shouldReturnFalseIfAutoSendSpecifiedAsFalseOnFormLevelButEnabledInSettings() { InMemFormsRepository formsRepository = new InMemFormsRepository(); formsRepository.save(new Form.Builder() .id(1L) .jrFormId("1") .jrVersion("1") .autoSend("false") .build()); assertThat(InstanceSubmitter.shouldFormBeSent(formsRepository, "1", "1", true), is(false)); }
@Deprecated public static boolean shouldFormBeSent(FormsRepository formsRepository, String jrFormId, String jrFormVersion, boolean isAutoSendAppSettingEnabled) { Form form = formsRepository.get(jrFormId, jrFormVersion); if (form == null) { return false; } return form.getAutoSend() == null ? isAutoSendAppSettingEnabled : Boolean.valueOf(form.getAutoSend()); }
InstanceSubmitter { @Deprecated public static boolean shouldFormBeSent(FormsRepository formsRepository, String jrFormId, String jrFormVersion, boolean isAutoSendAppSettingEnabled) { Form form = formsRepository.get(jrFormId, jrFormVersion); if (form == null) { return false; } return form.getAutoSend() == null ? isAutoSendAppSettingEnabled : Boolean.valueOf(form.getAutoSend()); } }
InstanceSubmitter { @Deprecated public static boolean shouldFormBeSent(FormsRepository formsRepository, String jrFormId, String jrFormVersion, boolean isAutoSendAppSettingEnabled) { Form form = formsRepository.get(jrFormId, jrFormVersion); if (form == null) { return false; } return form.getAutoSend() == null ? isAutoSendAppSettingEnabled : Boolean.valueOf(form.getAutoSend()); } InstanceSubmitter(Analytics analytics, FormsRepository formsRepository, InstancesRepository instancesRepository, GoogleAccountsManager googleAccountsManager, GoogleApiProvider googleApiProvider); }
InstanceSubmitter { @Deprecated public static boolean shouldFormBeSent(FormsRepository formsRepository, String jrFormId, String jrFormVersion, boolean isAutoSendAppSettingEnabled) { Form form = formsRepository.get(jrFormId, jrFormVersion); if (form == null) { return false; } return form.getAutoSend() == null ? isAutoSendAppSettingEnabled : Boolean.valueOf(form.getAutoSend()); } InstanceSubmitter(Analytics analytics, FormsRepository formsRepository, InstancesRepository instancesRepository, GoogleAccountsManager googleAccountsManager, GoogleApiProvider googleApiProvider); Pair<Boolean, String> submitUnsubmittedInstances(); Pair<Boolean, String> submitSelectedInstances(List<Instance> toUpload); @Deprecated static boolean shouldFormBeSent(FormsRepository formsRepository, String jrFormId, String jrFormVersion, boolean isAutoSendAppSettingEnabled); }
InstanceSubmitter { @Deprecated public static boolean shouldFormBeSent(FormsRepository formsRepository, String jrFormId, String jrFormVersion, boolean isAutoSendAppSettingEnabled) { Form form = formsRepository.get(jrFormId, jrFormVersion); if (form == null) { return false; } return form.getAutoSend() == null ? isAutoSendAppSettingEnabled : Boolean.valueOf(form.getAutoSend()); } InstanceSubmitter(Analytics analytics, FormsRepository formsRepository, InstancesRepository instancesRepository, GoogleAccountsManager googleAccountsManager, GoogleApiProvider googleApiProvider); Pair<Boolean, String> submitUnsubmittedInstances(); Pair<Boolean, String> submitSelectedInstances(List<Instance> toUpload); @Deprecated static boolean shouldFormBeSent(FormsRepository formsRepository, String jrFormId, String jrFormVersion, boolean isAutoSendAppSettingEnabled);  }