aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test
diff options
context:
space:
mode:
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>2023-05-08 10:58:39 +0200
committersonartech <sonartech@sonarsource.com>2023-05-08 20:03:47 +0000
commitbc1cd787ad0d474bfec5614eb0ca8ab5b1d9fc3f (patch)
tree3c34297f64885b03c51fc49737b4440702ffa10a /sonar-scanner-engine/src/test
parent204d9b7f21fb8807c8a53756d1234a00023a9206 (diff)
downloadsonarqube-bc1cd787ad0d474bfec5614eb0ca8ab5b1d9fc3f.tar.gz
sonarqube-bc1cd787ad0d474bfec5614eb0ca8ab5b1d9fc3f.zip
SONAR-18210 not computing the whole file metadata when only status is needed.
Co-authored-by: Duarte Meneses <duarte.meneses@sonarsource.com>
Diffstat (limited to 'sonar-scanner-engine/src/test')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/sarif/RegionMapperTest.java10
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java10
2 files changed, 10 insertions, 10 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/sarif/RegionMapperTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/sarif/RegionMapperTest.java
index 2b305833b52..6883d28e7ef 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/sarif/RegionMapperTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/externalissue/sarif/RegionMapperTest.java
@@ -48,8 +48,8 @@ import static org.mockito.Mockito.when;
public class RegionMapperTest {
private static final int LINE_END_OFFSET = 10;
private static final DefaultInputFile INPUT_FILE = new DefaultInputFile(new DefaultIndexedFile("ABCDE", Paths.get("module"), "relative/path", null),
- f -> f.setMetadata(generateMetadata()));
-
+ f -> f.setMetadata(generateMetadata()), f -> {
+ });
private static Metadata generateMetadata() {
Metadata metadata = mock(Metadata.class);
@@ -97,9 +97,9 @@ public class RegionMapperTest {
@DataProvider
public static Object[][] index() {
- return new Object[][]{
- {1,3, 0,2},
- {5,8, 4,7}
+ return new Object[][] {
+ {1, 3, 0, 2},
+ {5, 8, 4, 7}
};
}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java
index 1b7219ca85d..adaf4ed24a9 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java
@@ -30,11 +30,10 @@ import static org.apache.commons.lang.RandomStringUtils.random;
import static org.apache.commons.lang.RandomStringUtils.randomNumeric;
import static org.assertj.core.api.Assertions.assertThat;
-
public class ChangedFileTest {
@Test
- public void test_unMovedFile(){
+ public void test_unMovedFile() {
Path absolutePath = Path.of("/absolutePath");
ChangedFile changedFile = ChangedFile.of(absolutePath);
@@ -44,7 +43,7 @@ public class ChangedFileTest {
}
@Test
- public void test_movedFile(){
+ public void test_movedFile() {
Path absolutePath = Path.of("/absolutePath");
ChangedFile changedFile = ChangedFile.of(absolutePath, "/oldRelativePath");
@@ -54,7 +53,7 @@ public class ChangedFileTest {
}
@Test
- public void test_equalsAndHashCode(){
+ public void test_equalsAndHashCode() {
Path absolutePath = Path.of("/absolutePath");
ChangedFile changedFile1 = ChangedFile.of(absolutePath, "/oldRelativePath");
ChangedFile changedFile2 = ChangedFile.of(absolutePath, "/oldRelativePath");
@@ -76,7 +75,8 @@ public class ChangedFileTest {
private DefaultInputFile composeDefaultInputFile(Path path, String oldRelativeReference) {
DefaultIndexedFile indexedFile = composeDefaultIndexFile(path, oldRelativeReference);
- return new DefaultInputFile(indexedFile, f -> f.setPublished(true));
+ return new DefaultInputFile(indexedFile, f -> f.setPublished(true), f -> {
+ });
}
private DefaultIndexedFile composeDefaultIndexFile(Path path, String oldRelativePath) {