aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2019-10-11 13:57:27 -0500
committerSonarTech <sonartech@sonarsource.com>2019-10-12 20:21:04 +0200
commit4876424dd7c24074f4fa9fa073d7310295614179 (patch)
treef48fb58d75d644d3c1caeba756de5e9d4208abf4 /sonar-scanner-engine/src/test
parent403901698010a7e3899859dc3eaed32b8e9196e0 (diff)
downloadsonarqube-4876424dd7c24074f4fa9fa073d7310295614179.tar.gz
sonarqube-4876424dd7c24074f4fa9fa073d7310295614179.zip
SONAR-12427 Patterns to ignore all issues in files are not always taken into account
Diffstat (limited to 'sonar-scanner-engine/src/test')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScannerTest.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScannerTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScannerTest.java
index ab54b184c7d..cfa6d92e616 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScannerTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/issue/ignore/scanner/IssueExclusionsRegexpScannerTest.java
@@ -32,8 +32,6 @@ import java.util.regex.Pattern;
import java.util.stream.IntStream;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.FileMetadata;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
@@ -42,12 +40,11 @@ import org.sonar.scanner.issue.ignore.scanner.IssueExclusionsLoader.DoubleRegexp
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+import static org.mockito.Mockito.mock;
public class IssueExclusionsRegexpScannerTest {
private DefaultInputFile javaFile;
-
- @Mock
- private IssueExclusionPatternInitializer patternsInitializer;
+ private IssueExclusionPatternInitializer patternsInitializer = mock(IssueExclusionPatternInitializer.class);
private List<Pattern> allFilePatterns;
private List<DoubleRegexpMatcher> blockPatterns;
@@ -56,8 +53,6 @@ public class IssueExclusionsRegexpScannerTest {
@Before
public void init() {
- MockitoAnnotations.initMocks(this);
-
blockPatterns = Arrays.asList(new DoubleRegexpMatcher[] {
new DoubleRegexpMatcher(Pattern.compile("// SONAR-OFF"), Pattern.compile("// SONAR-ON")),
new DoubleRegexpMatcher(Pattern.compile("// FOO-OFF"), Pattern.compile("// FOO-ON"))