IssuesModel extends DetailsTableModel { @Override public IssuesRow getRow(final Issue issue) { IssuesRow row = new IssuesRow(getAgeBuilder(), getFileNameRenderer(), getDescriptionProvider(), issue, getJenkinsFacade()); row.setPackageName(issue); row.setCategory(issue); row.setType(issue); row.setSeverity(issue); return row; } IssuesModel(final Report report, final FileNameRenderer fileNameRenderer, final AgeBuilder ageBuilder,
            final DescriptionProvider descriptionProvider); @VisibleForTesting  IssuesModel(final Report report, final FileNameRenderer fileNameRenderer, final AgeBuilder ageBuilder,
            final DescriptionProvider descriptionProvider, final JenkinsFacade jenkinsFacade); @Override String getId(); @Override List<TableColumn> getColumns(); @Override IssuesRow getRow(final Issue issue);  }
@Test void shouldConvertIssuesToArrayWithAllColumns() { Report report = new Report(); Issue issue = createIssue(1); report.add(issue); report.add(createIssue(2)); IssuesModel model = createModel(report); String columnDefinitions = model.getColumnsDefinition(); assertThatJson(columnDefinitions).isArray().hasSize(7); String[] columns = {"description", "fileName", "packageName", "category", "type", "severity", "age"}; for (int column = 0; column < columns.length; column++) { verifyColumnProperty(model, column, columns[column]); } verifyFileNameColumn(columnDefinitions); assertThat(model.getRows()).hasSize(2); IssuesRow actualRow = model.getRow(issue); assertThat(actualRow).hasDescription(EXPECTED_DESCRIPTION) .hasAge("1") .hasPackageName(PACKAGE_NAME) .hasCategory("<a href=\"category.1296530210/\">category-1</a>") .hasType("<a href=\"type.-858804642/\">type-1</a>") .hasSeverity("<a href=\"HIGH\">High</a>"); assertThatDetailedColumnContains(actualRow.getFileName(), createExpectedFileName(issue), "/path/to/file-1:0000015"); }