/** Validate that the report pages were generated correctly */
  private void validateReports(GraphContext context) {
    ReportService reportService = new ReportService(context);
    ReportModel mainApplicationReportModel = getMainApplicationReport(context);
    Path mainAppReport =
        reportService.getReportDirectory().resolve(mainApplicationReportModel.getReportFilename());

    ReportModel catchallApplicationReportModel = getMigrationIssuesReport(context);
    Path catchallAppReport =
        reportService
            .getReportDirectory()
            .resolve(catchallApplicationReportModel.getReportFilename());

    TestJavaApplicationOverviewUtil javaApplicationOverviewUtil =
        new TestJavaApplicationOverviewUtil();
    javaApplicationOverviewUtil.loadPage(mainAppReport);
    javaApplicationOverviewUtil.checkFilePathEffort("catchalltest", "FileWithoutCatchallHits", 13);
    javaApplicationOverviewUtil.checkFilePathEffort("catchalltest", "FileWithBoth", 27);
    javaApplicationOverviewUtil.checkFilePathEffort("catchalltest", "FileWithNoHintsRules", 63);

    TestMigrationIssuesReportUtil migrationIssuesReportUtil = new TestMigrationIssuesReportUtil();
    migrationIssuesReportUtil.loadPage(catchallAppReport);

    Assert.assertTrue(
        migrationIssuesReportUtil.checkIssue(
            "java.util.* found ", 7, 7, "Requires architectural decision or change", 49));
  }
  private void validateMigrationIssuesReport(GraphContext context) {
    TestMigrationIssuesReportUtil util = new TestMigrationIssuesReportUtil();

    ApplicationReportService reportService = new ApplicationReportService(context);
    Iterable<ApplicationReportModel> reportModels =
        reportService.findAllByProperty(
            ReportModel.TEMPLATE_PATH, "/reports/templates/migration-issues.ftl");
    ApplicationReportModel reportModel = null;
    for (ApplicationReportModel possibleModel : reportModels) {
      if (possibleModel.getProjectModel() != null) {
        reportModel = possibleModel;
        break;
      }
    }

    if (reportModel == null) throw new RuntimeException("Failed to find migration issues report!");

    Path reportPath =
        Paths.get(new ReportService(context).getReportDirectory(), reportModel.getReportFilename());
    util.loadPage(reportPath);

    Assert.assertTrue(
        util.checkIssue("Classification ActivationConfigProperty", 2, 8, "Unknown", 16));
    Assert.assertTrue(util.checkIssue("Title for Hint from XML", 1, 0, "Info", 0));
    Assert.assertTrue(util.checkIssue("Web Servlet", 1, 0, "Info", 0));
  }