aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine
diff options
context:
space:
mode:
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>2021-10-13 13:18:08 +0200
committersonartech <sonartech@sonarsource.com>2021-10-13 20:03:34 +0000
commitb5fbdff6d4c84c5fbc26adc5a07170fc7ba5acf4 (patch)
treeca7014faa8fbbf48dd5f150df39860726cd4b89f /sonar-scanner-engine
parentbd9d0d1826db23c9bacb5dd474677a3381f8fe98 (diff)
downloadsonarqube-b5fbdff6d4c84c5fbc26adc5a07170fc7ba5acf4.tar.gz
sonarqube-b5fbdff6d4c84c5fbc26adc5a07170fc7ba5acf4.zip
SONAR-15487 added unit test for quickFixAvailable added in Issue and DefaultIssue
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java
index fb79e7896c6..5e619c5d088 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/IssuePublisherTest.java
@@ -128,7 +128,8 @@ public class IssuePublisherTest {
DefaultIssue issue = new DefaultIssue(project)
.at(new DefaultIssueLocation().on(file).at(file.selectLine(3)).message("Foo"))
.forRule(SQUID_RULE_KEY)
- .overrideSeverity(org.sonar.api.batch.rule.Severity.CRITICAL);
+ .overrideSeverity(org.sonar.api.batch.rule.Severity.CRITICAL)
+ .setQuickFixAvailable(true);
when(filters.accept(any(InputComponent.class), any(ScannerReport.Issue.class))).thenReturn(true);
@@ -138,6 +139,7 @@ public class IssuePublisherTest {
ArgumentCaptor<ScannerReport.Issue> argument = ArgumentCaptor.forClass(ScannerReport.Issue.class);
verify(reportPublisher.getWriter()).appendComponentIssue(eq(file.scannerId()), argument.capture());
assertThat(argument.getValue().getSeverity()).isEqualTo(org.sonar.scanner.protocol.Constants.Severity.CRITICAL);
+ assertThat(argument.getValue().getQuickFixAvailable()).isTrue();
}
@Test