@Test void shouldProvideSummary() { AnalysisResult analysisResult = createAnalysisResult( Maps.fixedSize.of("checkstyle", 15, "pmd", 20), 2, 2, EMPTY_ERRORS, 1); Summary summary = createSummary(analysisResult); String actualSummary = summary.create(); assertThat(actualSummary).contains("CheckStyle, PMD"); assertThat(actualSummary).contains("No warnings for 2 builds"); assertThat(actualSummary).contains("since build <a href=\"../1\" class=\"model-link inside\">1</a>"); assertThat(actualSummary).containsPattern( createWarningsLink("<a href=\"test/new\">.*2 new warnings.*</a>")); assertThat(actualSummary).containsPattern( createWarningsLink("<a href=\"test/fixed\">.*2 fixed warnings.*</a>")); assertThat(actualSummary).contains( "Quality gate: <img src=\"color\" class=\"icon-blue\" alt=\"Success\" title=\"Success\"> Success\n"); assertThat(actualSummary).contains("Reference build: <a href=\"absoluteUrl\">Job #15</a>"); }
public String create() { return div(labelProvider.getTitle(analysisResult, !analysisResult.getErrorMessages().isEmpty()), createDescription()) .withId(labelProvider.getId() + "-summary") .renderFormatted(); }
Summary { public String create() { return div(labelProvider.getTitle(analysisResult, !analysisResult.getErrorMessages().isEmpty()), createDescription()) .withId(labelProvider.getId() + "-summary") .renderFormatted(); } }
Summary { public String create() { return div(labelProvider.getTitle(analysisResult, !analysisResult.getErrorMessages().isEmpty()), createDescription()) .withId(labelProvider.getId() + "-summary") .renderFormatted(); } Summary(final StaticAnalysisLabelProvider labelProvider, final AnalysisResult result); @VisibleForTesting  Summary(final StaticAnalysisLabelProvider labelProvider, final AnalysisResult result,
            final LabelProviderFactoryFacade facade); }
Summary { public String create() { return div(labelProvider.getTitle(analysisResult, !analysisResult.getErrorMessages().isEmpty()), createDescription()) .withId(labelProvider.getId() + "-summary") .renderFormatted(); } Summary(final StaticAnalysisLabelProvider labelProvider, final AnalysisResult result); @VisibleForTesting  Summary(final StaticAnalysisLabelProvider labelProvider, final AnalysisResult result,
            final LabelProviderFactoryFacade facade); String create(); }
Summary { public String create() { return div(labelProvider.getTitle(analysisResult, !analysisResult.getErrorMessages().isEmpty()), createDescription()) .withId(labelProvider.getId() + "-summary") .renderFormatted(); } Summary(final StaticAnalysisLabelProvider labelProvider, final AnalysisResult result); @VisibleForTesting  Summary(final StaticAnalysisLabelProvider labelProvider, final AnalysisResult result,
            final LabelProviderFactoryFacade facade); String create();  }