aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2018-04-13 15:53:41 +0200
committerSonarTech <sonartech@sonarsource.com>2018-04-26 20:20:51 +0200
commit4cbf46ae604e6619c5b1fdaab81f5dd28f464a0e (patch)
treeb62848cb8ff1a44c47c575f09204e57388f42765 /sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor
parent362d39c55912ee01e9bec4b0155bee601111ad91 (diff)
downloadsonarqube-4cbf46ae604e6619c5b1fdaab81f5dd28f464a0e.tar.gz
sonarqube-4cbf46ae604e6619c5b1fdaab81f5dd28f464a0e.zip
SONAR-10588 Don't import external issues in preview mode
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorContextTest.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorContextTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorContextTest.java
index 24cc70506be..ee1c4a34872 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorContextTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sensor/DefaultSensorContextTest.java
@@ -86,11 +86,21 @@ public class DefaultSensorContextTest {
assertThat(adaptor.newIssue()).isNotNull();
assertThat(adaptor.newExternalIssue()).isNotNull();
assertThat(adaptor.newMeasure()).isNotNull();
-
+ assertThat(adaptor.newAnalysisError()).isEqualTo(DefaultSensorContext.NO_OP_NEW_ANALYSIS_ERROR);
assertThat(adaptor.isCancelled()).isFalse();
}
@Test
+ public void shouldSkipSeveralObjectsInPreviewMode() {
+ when(analysisMode.isIssues()).thenReturn(true);
+ when(analysisMode.isPreview()).thenReturn(true);
+ assertThat(adaptor.newCpdTokens()).isEqualTo(DefaultSensorContext.NO_OP_NEW_CPD_TOKENS);
+ assertThat(adaptor.newSymbolTable()).isEqualTo(DefaultSensorContext.NO_OP_NEW_SYMBOL_TABLE);
+ assertThat(adaptor.newExternalIssue()).isEqualTo(DefaultSensorContext.NO_OP_NEW_EXTERNAL_ISSUE);
+ assertThat(adaptor.newHighlighting()).isEqualTo(DefaultSensorContext.NO_OP_NEW_HIGHLIGHTING);
+ }
+
+ @Test
public void shouldSkipDupsAndCoverageOnShortBranches() {
when(branchConfig.isShortOrPullRequest()).thenReturn(true);
assertThat(adaptor.newCpdTokens()).isEqualTo(DefaultSensorContext.NO_OP_NEW_CPD_TOKENS);