@Test void shouldContainEmptyJobPlaceHolder() { JenkinsFacade jenkins = mock(JenkinsFacade.class); ModelValidation model = new ModelValidation(jenkins); ComboBoxModel actualModel = model.getAllJobs(); assertThat(actualModel).hasSize(1); assertThat(actualModel).containsExactly(NO_REFERENCE_JOB); }
public ComboBoxModel getAllJobs() { ComboBoxModel model = new ComboBoxModel(jenkins.getAllJobNames()); model.add(0, NO_REFERENCE_JOB); return model; }
ModelValidation { public ComboBoxModel getAllJobs() { ComboBoxModel model = new ComboBoxModel(jenkins.getAllJobNames()); model.add(0, NO_REFERENCE_JOB); return model; } }
ModelValidation { public ComboBoxModel getAllJobs() { ComboBoxModel model = new ComboBoxModel(jenkins.getAllJobNames()); model.add(0, NO_REFERENCE_JOB); return model; } ModelValidation(); @VisibleForTesting  ModelValidation(final JenkinsFacade jenkins); }
ModelValidation { public ComboBoxModel getAllJobs() { ComboBoxModel model = new ComboBoxModel(jenkins.getAllJobNames()); model.add(0, NO_REFERENCE_JOB); return model; } ModelValidation(); @VisibleForTesting  ModelValidation(final JenkinsFacade jenkins); ComboBoxModel getAllCharsets(); Charset getCharset(@CheckForNull final String charset); void ensureValidId(final String id); FormValidation validateId(final String id); FormValidation validateCharset(final String reportEncoding); ListBoxModel getAllSeverityFilters(); ListBoxModel getAllTrendChartTypes(); ComboBoxModel getAllJobs(); FormValidation validateJob(final String referenceJobName); @SuppressWarnings("WeakerAccess") FormValidation validateThreshold(@QueryParameter final int threshold); FormValidation validateHealthy(final int healthy, final int unhealthy); FormValidation validateUnhealthy(final int healthy, final int unhealthy); FormValidation doCheckPattern(@AncestorInPath final AbstractProject<?, ?> project,
            @QueryParameter final String pattern); FormValidation doCheckSourceDirectory(@AncestorInPath final AbstractProject<?, ?> project,
            @QueryParameter final String sourceDirectory); }
ModelValidation { public ComboBoxModel getAllJobs() { ComboBoxModel model = new ComboBoxModel(jenkins.getAllJobNames()); model.add(0, NO_REFERENCE_JOB); return model; } ModelValidation(); @VisibleForTesting  ModelValidation(final JenkinsFacade jenkins); ComboBoxModel getAllCharsets(); Charset getCharset(@CheckForNull final String charset); void ensureValidId(final String id); FormValidation validateId(final String id); FormValidation validateCharset(final String reportEncoding); ListBoxModel getAllSeverityFilters(); ListBoxModel getAllTrendChartTypes(); ComboBoxModel getAllJobs(); FormValidation validateJob(final String referenceJobName); @SuppressWarnings("WeakerAccess") FormValidation validateThreshold(@QueryParameter final int threshold); FormValidation validateHealthy(final int healthy, final int unhealthy); FormValidation validateUnhealthy(final int healthy, final int unhealthy); FormValidation doCheckPattern(@AncestorInPath final AbstractProject<?, ?> project,
            @QueryParameter final String pattern); FormValidation doCheckSourceDirectory(@AncestorInPath final AbstractProject<?, ?> project,
            @QueryParameter final String sourceDirectory);  }