diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2018-04-19 16:30:38 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-04-26 20:20:52 +0200 |
commit | 2552e0dcff500d999401cce943a87dcc766eb623 (patch) | |
tree | 897a4be103b1d96e338a51382a9ff0d7d45dfe10 /sonar-scanner-engine | |
parent | 4c9a714da9a988f779652f43e53bf2dc23d8cbeb (diff) | |
download | sonarqube-2552e0dcff500d999401cce943a87dcc766eb623.tar.gz sonarqube-2552e0dcff500d999401cce943a87dcc766eb623.zip |
SONAR-10544 fix tests
Diffstat (limited to 'sonar-scanner-engine')
3 files changed, 5 insertions, 0 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java index f484f0bd195..b68fa4c910f 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java @@ -58,6 +58,7 @@ public class ExternalIssueImporter { NewExternalIssue externalIssue = context.newExternalIssue() .forRule(RuleKey.of(issue.engineId, issue.ruleId)) .severity(Severity.valueOf(issue.severity)) + .remediationEffortMinutes(20L) .type(RuleType.valueOf(issue.type)); NewIssueLocation primary = fillLocation(context, externalIssue.newLocation(), issue.primaryLocation); diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ReportParser.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ReportParser.java index 61c35a05eb8..80728310026 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ReportParser.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ReportParser.java @@ -108,6 +108,8 @@ public class ReportParser { String ruleId; String severity; String type; + @Nullable + Integer effortMinutes; Location primaryLocation; @Nullable Location[] secondaryLocations; diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ModuleIssuesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ModuleIssuesTest.java index 6309720339d..eba43f72564 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ModuleIssuesTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ModuleIssuesTest.java @@ -33,6 +33,7 @@ import org.sonar.api.batch.sensor.issue.internal.DefaultIssue; import org.sonar.api.batch.sensor.issue.internal.DefaultIssueLocation; import org.sonar.api.rule.RuleKey; import org.sonar.api.rule.Severity; +import org.sonar.api.rules.RuleType; import org.sonar.api.utils.MessageException; import org.sonar.scanner.protocol.output.ScannerReport; import org.sonar.scanner.report.ReportPublisher; @@ -154,6 +155,7 @@ public class ModuleIssuesTest { DefaultExternalIssue issue = new DefaultExternalIssue() .at(new DefaultIssueLocation().on(file).at(file.selectLine(3)).message("Foo")) + .type(RuleType.BUG) .forRule(SQUID_RULE_KEY) .severity(org.sonar.api.batch.rule.Severity.CRITICAL); |