@Test void shouldReturnLabelProviderNameOnOrigin() { JenkinsFacade jenkins = mock(JenkinsFacade.class); when(jenkins.getDescriptorsFor(Tool.class)).thenReturn( DescriptorExtensionList.createDescriptorList((Jenkins)null, Tool.class)); BuildFolderFacade buildFolder = mock(BuildFolderFacade.class); DetailFactory detailFactory = new DetailFactory(jenkins, buildFolder); Object details = detailFactory.createTrendDetails("origin." + TOOL_ID.hashCode(), RUN, createResult(), ALL_ISSUES, NEW_ISSUES, OUTSTANDING_ISSUES, FIXED_ISSUES, ENCODING, createParent()); assertThat(details).isInstanceOfSatisfying(IssuesDetail.class, d -> assertThat(d.getDisplayName()).isEqualTo("Static Analysis")); }
@SuppressWarnings({"PMD.CyclomaticComplexity", "checkstyle:ParameterNumber"}) Object createTrendDetails(final String link, final Run<?, ?> owner, final AnalysisResult result, final Report allIssues, final Report newIssues, final Report outstandingIssues, final Report fixedIssues, final Charset sourceEncoding, final IssuesDetail parent) { StaticAnalysisLabelProvider labelProvider = parent.getLabelProvider(); if (link.contains(LINK_SEPARATOR)) { return createFilteredView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } else { return createNewDetailView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } }
DetailFactory { @SuppressWarnings({"PMD.CyclomaticComplexity", "checkstyle:ParameterNumber"}) Object createTrendDetails(final String link, final Run<?, ?> owner, final AnalysisResult result, final Report allIssues, final Report newIssues, final Report outstandingIssues, final Report fixedIssues, final Charset sourceEncoding, final IssuesDetail parent) { StaticAnalysisLabelProvider labelProvider = parent.getLabelProvider(); if (link.contains(LINK_SEPARATOR)) { return createFilteredView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } else { return createNewDetailView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } } }
DetailFactory { @SuppressWarnings({"PMD.CyclomaticComplexity", "checkstyle:ParameterNumber"}) Object createTrendDetails(final String link, final Run<?, ?> owner, final AnalysisResult result, final Report allIssues, final Report newIssues, final Report outstandingIssues, final Report fixedIssues, final Charset sourceEncoding, final IssuesDetail parent) { StaticAnalysisLabelProvider labelProvider = parent.getLabelProvider(); if (link.contains(LINK_SEPARATOR)) { return createFilteredView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } else { return createNewDetailView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } } DetailFactory(); @VisibleForTesting  DetailFactory(final JenkinsFacade jenkinsFacade, final BuildFolderFacade buildFolder); }
DetailFactory { @SuppressWarnings({"PMD.CyclomaticComplexity", "checkstyle:ParameterNumber"}) Object createTrendDetails(final String link, final Run<?, ?> owner, final AnalysisResult result, final Report allIssues, final Report newIssues, final Report outstandingIssues, final Report fixedIssues, final Charset sourceEncoding, final IssuesDetail parent) { StaticAnalysisLabelProvider labelProvider = parent.getLabelProvider(); if (link.contains(LINK_SEPARATOR)) { return createFilteredView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } else { return createNewDetailView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } } DetailFactory(); @VisibleForTesting  DetailFactory(final JenkinsFacade jenkinsFacade, final BuildFolderFacade buildFolder);  }
DetailFactory { @SuppressWarnings({"PMD.CyclomaticComplexity", "checkstyle:ParameterNumber"}) Object createTrendDetails(final String link, final Run<?, ?> owner, final AnalysisResult result, final Report allIssues, final Report newIssues, final Report outstandingIssues, final Report fixedIssues, final Charset sourceEncoding, final IssuesDetail parent) { StaticAnalysisLabelProvider labelProvider = parent.getLabelProvider(); if (link.contains(LINK_SEPARATOR)) { return createFilteredView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } else { return createNewDetailView(link, owner, result, allIssues, newIssues, outstandingIssues, fixedIssues, sourceEncoding, parent, labelProvider); } } DetailFactory(); @VisibleForTesting  DetailFactory(final JenkinsFacade jenkinsFacade, final BuildFolderFacade buildFolder);   }