FormService { public List<FormSection> getFormSections(String formName) { if (this.formsMap.containsKey(formName)) { return this.formsMap.get(formName).getFormsections(); } return Collections.emptyList(); } @Inject  FormService(RapidFtrApplication context); void downloadPublishedFormSections(); List<FormSection> getFormSections(String formName); void setFormSections(List<FormSection> formSections); List<FormField> getHighlightedFields(String formName); List<FormField> getTitleFields(String formName); static final String FORM_SECTIONS_PREF; static final String API_FORM_SECTIONS_PATH; }
@Test public void shouldLoadDefaultFormSections() throws IOException { when(sharedPreferences.getString(FormService.FORM_SECTIONS_PREF, null)).thenReturn(null); int noOfChildFormSectionsBeforeDownload = 10, noOfEnquiryFormSectionsBeforeDownload = 7; assertEquals(noOfChildFormSectionsBeforeDownload, formService.getFormSections(Child.CHILD_FORM_NAME).size()); assertEquals(noOfEnquiryFormSectionsBeforeDownload, formService.getFormSections(Enquiry.ENQUIRY_FORM_NAME).size()); }