public void execute() {
    if (report.rules != null) {
      importNewFormat();
    } else {
      importDeprecatedFormat();
    }
  }
@Test
  public void execute_whenDeprecatedFormatWithMinimalInfo() {
    ExternalIssueReport report = new ExternalIssueReport();
    ExternalIssueReport.Issue input = new ExternalIssueReport.Issue();
    input.engineId = "findbugs";
    input.ruleId = "123";
    input.severity = "CRITICAL";
    input.type = "BUG";
    input.primaryLocation = new ExternalIssueReport.Location();
    input.primaryLocation.filePath = sourceFile.getProjectRelativePath();
    input.primaryLocation.message = randomAlphabetic(5);
    report.issues = new ExternalIssueReport.Issue[]{input};

    ExternalIssueImporter underTest = new ExternalIssueImporter(this.context, report);
    underTest.execute();

    assertThat(context.allExternalIssues()).hasSize(1);
    ExternalIssue output = context.allExternalIssues().iterator().next();
    assertThat(output.engineId()).isEqualTo(input.engineId);
    assertThat(output.ruleId()).isEqualTo(input.ruleId);
    assertThat(output.severity()).isEqualTo(Severity.valueOf(input.severity));
    assertThat(output.remediationEffort()).isNull();
    assertThat(logs.logs(Level.INFO)).contains("Imported 1 issue in 1 file");
  }