@Override
  public SarifImportResults importSarif(SarifSchema210 sarif210) {
    int successFullyImportedIssues = 0;
    int successFullyImportedRuns = 0;
    int failedRuns = 0;

    List<Run> runs = requireNonNull(sarif210.getRuns(), "The runs section of the Sarif report is null");
    for (Run run : runs) {
      RunMapperResult runMapperResult = tryMapRun(run);
      if (runMapperResult.isSuccess()) {
        List<NewAdHocRule> newAdHocRules = runMapperResult.getNewAdHocRules();
        newAdHocRules.forEach(NewAdHocRule::save);

        List<NewExternalIssue> newExternalIssues = runMapperResult.getNewExternalIssues();
        successFullyImportedRuns += 1;
        successFullyImportedIssues += newExternalIssues.size();
        newExternalIssues.forEach(NewExternalIssue::save);
      } else {
        failedRuns += 1;
      }
    }
    return SarifImportResults.builder()
      .successFullyImportedIssues(successFullyImportedIssues)
      .successFullyImportedRuns(successFullyImportedRuns)
      .failedRuns(failedRuns)
      .build();
  }
@Test
  public void importSarif_whenGetRunsReturnNull_shouldFailWithProperMessage() {
    SarifSchema210 sarif210 = mock(SarifSchema210.class);

    when(sarif210.getRuns()).thenReturn(null);

    assertThatNullPointerException()
      .isThrownBy(() -> sarif210Importer.importSarif(sarif210))
      .withMessage("The runs section of the Sarif report is null");

    verifyNoInteractions(runMapper);
  }