@Test void canParseMultipleViolationInRows() { Report report = new Report(); parser.parse(report, AxIssueKind.SV, dashboard.getIssuesFrom( "/io/jenkins/plugins/analysis/warnings/axivion/multiple-violations.json")); assertThat(report).hasSize(3); }
void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } AxivionParser(
            final String projectUrl,
            final String baseDir); }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } AxivionParser(
            final String projectUrl,
            final String baseDir);  }
AxivionParser implements Serializable { void parse(final Report report, final AxIssueKind kind, final JsonObject payload) { final JsonArray jsonArray = payload.getAsJsonArray("rows"); if (jsonArray != null) { report.logInfo("Importing %s %s", jsonArray.size(), kind.plural()); StreamSupport.stream(jsonArray.spliterator(), false) .filter(JsonObject.class::isInstance) .map(JsonObject.class::cast) .map(issueAsJson -> new AxRawIssue(projectUrl, baseDir, issueAsJson, kind)) .map(kind::transform) .forEach(report::add); } } AxivionParser(
            final String projectUrl,
            final String baseDir);   }