import org.sonar.scanner.bootstrap.AbstractAnalysisMode;
import org.sonar.scanner.bootstrap.GlobalProperties;
import org.sonar.scanner.scan.BranchConfiguration;
-import org.sonar.scanner.scan.BranchConfiguration.BranchType;
@Immutable
public class DefaultAnalysisMode extends AbstractAnalysisMode {
// make sure analysis is consistent with global properties
boolean globalPreview = isIssues(globalProps);
boolean analysisPreview = isIssues(analysisProps);
- boolean shortLivingBranch = branchConfig.branchType() == BranchType.SHORT;
if (!globalPreview && analysisPreview) {
throw new IllegalStateException("Inconsistent properties: global properties doesn't enable issues mode while analysis properties enables it");
}
- load(globalProps, analysisProps, shortLivingBranch);
+ load(globalProps, analysisProps, branchConfig.isShortLivingBranch());
}
private void load(Map<String, String> globalProps, Map<String, String> analysisProps, boolean isShortLivingBranch) {
*/
package org.sonar.scanner.cpd;
-import static com.google.common.collect.FluentIterable.from;
-
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.internal.DefaultInputComponent;
import org.sonar.scanner.protocol.output.ScannerReport.Duplication;
import org.sonar.scanner.report.ReportPublisher;
import org.sonar.scanner.scan.BranchConfiguration;
-import org.sonar.scanner.scan.BranchConfiguration.BranchType;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
import org.sonar.scanner.util.ProgressReport;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
+import static com.google.common.collect.FluentIterable.from;
/**
* Runs on the root module, at the end of the project analysis.
}
public void execute() {
- if (branchConfiguration.branchType() == BranchType.SHORT) {
+ if (branchConfiguration.isShortLivingBranch()) {
LOG.info("Skipping CPD calculation for short living branch");
return;
}
import org.sonar.scanner.protocol.output.ScannerReportReader;
import org.sonar.scanner.protocol.output.ScannerReportWriter;
import org.sonar.scanner.scan.BranchConfiguration;
-import org.sonar.scanner.scan.BranchConfiguration.BranchType;
/**
* Adds components and analysis metadata to output report
this.branchConfiguration = branchConfiguration;
}
- private boolean isShortLivingBranch() {
- return branchConfiguration.branchType() == BranchType.SHORT;
- }
-
@Override
public void publish(ScannerReportWriter writer) {
this.reader = new ScannerReportReader(writer.getFileStructure().root());
}
private boolean shouldSkipComponent(DefaultInputComponent component, Collection<InputComponent> children) {
- if (component instanceof InputModule && children.isEmpty() && isShortLivingBranch()) {
+ if (component instanceof InputModule && children.isEmpty() && branchConfiguration.isShortLivingBranch()) {
// no children on a module in short branch analysis -> skip it (except root)
return !moduleHierarchy.isRoot((InputModule) component);
} else if (component instanceof InputDir && children.isEmpty()) {
} else if (component instanceof DefaultInputFile) {
// skip files not marked for publishing
DefaultInputFile inputFile = (DefaultInputFile) component;
- return !inputFile.isPublished() || (isShortLivingBranch() && inputFile.status() == Status.SAME);
+ return !inputFile.isPublished() || (branchConfiguration.isShortLivingBranch() && inputFile.status() == Status.SAME);
}
return false;
}
*/
BranchType branchType();
+ default boolean isShortLivingBranch() {
+ return branchType() == BranchType.SHORT;
+ }
+
/**
* The name of the branch.
*/
}
private static String toDisplayName(BranchConfiguration.BranchType branchType) {
- if (branchType == BranchConfiguration.BranchType.LONG) {
- return "long living";
- } else if (branchType == BranchConfiguration.BranchType.SHORT) {
- return "short living";
+ switch (branchType) {
+ case LONG:
+ return "long living";
+ case SHORT:
+ return "short living";
+ default:
+ throw new UnsupportedOperationException("unknown branch type: " + branchType);
}
- throw new UnsupportedOperationException("unknown branch type: " + branchType);
}
private void scanRecursively(InputModuleHierarchy tree, DefaultInputModule module) {
import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.batch.fs.internal.FileExtensionPredicate;
import org.sonar.api.scan.filesystem.PathResolver;
+import org.sonar.scanner.scan.BranchConfiguration;
/**
* Store of all files and dirs. This cache is shared amongst all project modules. Inclusion and
private final SetMultimap<String, InputFile> filesByExtensionCache = LinkedHashMultimap.create();
private final InputModule root;
private final AnalysisMode mode;
+ private final BranchConfiguration branchConfiguration;
- public InputComponentStore(DefaultInputModule root, AnalysisMode mode) {
+ public InputComponentStore(DefaultInputModule root, AnalysisMode mode, BranchConfiguration branchConfiguration) {
this.root = root;
this.mode = mode;
+ this.branchConfiguration = branchConfiguration;
this.put(root);
}
return inputFileCache.values().stream()
.map(f -> (DefaultInputFile) f)
.filter(DefaultInputFile::isPublished)
- .filter(f -> !mode.isIncremental() || f.status() != Status.SAME)::iterator;
+ .filter(f -> (!mode.isIncremental() && !branchConfiguration.isShortLivingBranch()) || f.status() != Status.SAME)::iterator;
}
public Iterable<InputFile> allFiles() {
import org.picocontainer.injectors.ProviderAdapter;
import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.fs.internal.InputModuleHierarchy;
+import org.sonar.scanner.scan.BranchConfiguration;
public class InputComponentStoreProvider extends ProviderAdapter {
private InputComponentStore store;
- public InputComponentStore provide(InputModuleHierarchy hierarchy, AnalysisMode mode) {
+ public InputComponentStore provide(InputModuleHierarchy hierarchy, AnalysisMode mode, BranchConfiguration branchConfiguration) {
if (store == null) {
- store = new InputComponentStore(hierarchy.root(), mode);
+ store = new InputComponentStore(hierarchy.root(), mode, branchConfiguration);
}
return store;
}
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
public synchronized void blameResult(InputFile file, List<BlameLine> lines) {
Preconditions.checkNotNull(file);
Preconditions.checkNotNull(lines);
- Preconditions.checkArgument(allFilesToBlame.contains(file), "It was not expected to blame file %s", file.relativePath());
+ Preconditions.checkArgument(allFilesToBlame.contains(file), "It was not expected to blame file %s", file);
if (lines.size() != file.lines()) {
- LOG.debug("Ignoring blame result since provider returned {} blame lines but file {} has {} lines", lines.size(), file.relativePath(), file.lines());
+ LOG.debug("Ignoring blame result since provider returned {} blame lines but file {} has {} lines", lines.size(), file, file.lines());
return;
}
}
private static void validateLine(BlameLine line, int lineId, InputFile file) {
- Preconditions.checkArgument(StringUtils.isNotBlank(line.revision()), "Blame revision is blank for file %s at line %s", file.relativePath(), lineId);
- Preconditions.checkArgument(line.date() != null, "Blame date is null for file %s at line %s", file.relativePath(), lineId);
+ Preconditions.checkArgument(StringUtils.isNotBlank(line.revision()), "Blame revision is blank for file %s at line %s", file, lineId);
+ Preconditions.checkArgument(line.date() != null, "Blame date is null for file %s at line %s", file, lineId);
}
private static void addChangeset(Builder scmBuilder, BlameLine line) {
if (inputString == null) {
return "";
}
- return inputString.toLowerCase();
+ return inputString.toLowerCase(Locale.US);
}
public void finish(boolean success) {
if (success && !allFilesToBlame.isEmpty()) {
LOG.warn("Missing blame information for the following files:");
for (InputFile f : allFilesToBlame) {
- LOG.warn(" * " + f.absolutePath());
+ LOG.warn(" * " + f);
}
LOG.warn("This may lead to missing/broken features in SonarQube");
}
import org.sonar.scanner.report.ReportPublisher;
import org.sonar.scanner.repository.FileData;
import org.sonar.scanner.repository.ProjectRepositories;
+import org.sonar.scanner.scan.BranchConfiguration;
import org.sonar.scanner.scan.filesystem.DefaultModuleFileSystem;
import org.sonar.scanner.scan.filesystem.ModuleInputComponentStore;
private final ModuleInputComponentStore componentStore;
private final DefaultModuleFileSystem fs;
private final ScannerReportWriter writer;
+ private final BranchConfiguration branchConfiguration;
public ScmPublisher(DefaultInputModule inputModule, ScmConfiguration configuration, ProjectRepositories projectRepositories,
- ModuleInputComponentStore componentStore, DefaultModuleFileSystem fs, ReportPublisher reportPublisher) {
+ ModuleInputComponentStore componentStore, DefaultModuleFileSystem fs, ReportPublisher reportPublisher, BranchConfiguration branchConfiguration) {
this.inputModule = inputModule;
this.configuration = configuration;
this.projectRepositories = projectRepositories;
this.componentStore = componentStore;
this.fs = fs;
+ this.branchConfiguration = branchConfiguration;
this.writer = reportPublisher.getWriter();
}
}
if (configuration.forceReloadAll() || f.status() != Status.SAME) {
addIfNotEmpty(filesToBlame, f);
- } else {
+ } else if (!branchConfiguration.isShortLivingBranch()) {
// File status is SAME so that mean fileData exists
FileData fileData = projectRepositories.fileData(inputModule.definition().getKeyWithBranch(), inputFile.getModuleRelativePath());
if (StringUtils.isEmpty(fileData.revision())) {
package org.sonar.scanner.sensor;
import java.io.Serializable;
-
import javax.annotation.concurrent.ThreadSafe;
-
import org.sonar.api.SonarRuntime;
import org.sonar.api.batch.AnalysisMode;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.config.Settings;
import org.sonar.api.utils.Version;
import org.sonar.scanner.scan.BranchConfiguration;
-import org.sonar.scanner.scan.BranchConfiguration.BranchType;
import org.sonar.scanner.sensor.noop.NoOpNewAnalysisError;
import org.sonar.scanner.sensor.noop.NoOpNewCoverage;
import org.sonar.scanner.sensor.noop.NoOpNewCpdTokens;
@Override
public NewCoverage newCoverage() {
- if (branchConfiguration.branchType() == BranchType.SHORT) {
+ if (branchConfiguration.isShortLivingBranch()) {
return NO_OP_NEW_COVERAGE;
}
return new DefaultCoverage(sensorStorage);
@Override
public NewCpdTokens newCpdTokens() {
- if (analysisMode.isIssues() || branchConfiguration.branchType() == BranchType.SHORT) {
+ if (analysisMode.isIssues() || branchConfiguration.isShortLivingBranch()) {
return NO_OP_NEW_CPD_TOKENS;
}
return new DefaultCpdTokens(config, sensorStorage);
import org.sonar.scanner.protocol.output.ScannerReportWriter;
import org.sonar.scanner.report.ReportPublisher;
import org.sonar.scanner.scan.BranchConfiguration;
-import org.sonar.scanner.scan.BranchConfiguration.BranchType;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
import static org.assertj.core.api.Assertions.assertThat;
index = new SonarCpdBlockIndex(publisher, settings);
DefaultInputModule inputModule = TestInputFileBuilder.newDefaultInputModule("foo", baseDir);
- componentStore = new InputComponentStore(inputModule, mock(AnalysisMode.class));
+ componentStore = new InputComponentStore(inputModule, mock(AnalysisMode.class), mock(BranchConfiguration.class));
executor = new CpdExecutor(settings, index, publisher, componentStore, branchConfig);
reader = new ScannerReportReader(outputDir);
@Test
public void skipIfShortBranch() {
- when(branchConfig.branchType()).thenReturn(BranchType.SHORT);
+ when(branchConfig.isShortLivingBranch()).thenReturn(true);
index = mock(SonarCpdBlockIndex.class);
executor = new CpdExecutor(settings, index, publisher, componentStore, branchConfig);
public class BranchMediumTest {
+ private static final String PROJECT_KEY = "sample";
+ private static final String FILE_PATH = "HelloJava.xoo";
+ private static final String FILE_CONTENT = "xoooo";
private File baseDir;
- private final String relativePath = "HelloJava.xoo";
@Rule
public TemporaryFolder temp = new TemporaryFolder();
@Before
public void prepare() throws IOException {
baseDir = temp.newFolder();
- Path filepath = baseDir.toPath().resolve(relativePath);
- Files.write(filepath, "xoooo".getBytes());
+ Path filepath = baseDir.toPath().resolve(FILE_PATH);
+ Files.write(filepath, FILE_CONTENT.getBytes());
String md5sum = new FileMetadata()
- .readMetadata(Files.newInputStream(filepath), StandardCharsets.UTF_8, relativePath)
+ .readMetadata(Files.newInputStream(filepath), StandardCharsets.UTF_8, FILE_PATH)
.hash();
- tester.addFileData("sample", relativePath, new FileData(md5sum, null));
+ tester.addFileData(PROJECT_KEY, FILE_PATH, new FileData(md5sum, "1.1"));
}
@Test
public void should_skip_report_for_unchanged_files_in_short_branch() {
// sanity check, normally report gets generated
TaskResult result = getResult(tester);
- assertThat(getResult(tester).getReportComponent(result.inputFile(relativePath).key())).isNotNull();
+ assertThat(getResult(tester).getReportComponent(result.inputFile(FILE_PATH).key())).isNotNull();
+ int fileId = 2;
+ assertThat(result.getReportReader().readChangesets(fileId)).isNotNull();
+ assertThat(result.getReportReader().hasCoverage(fileId)).isTrue();
+ assertThat(result.getReportReader().readFileSource(fileId)).isNotNull();
// file is skipped for short branches (no report, no coverage, no duplications)
TaskResult result2 = getResult(tester.setBranchType(BranchConfiguration.BranchType.SHORT));
- assertThat(result2.getReportComponent(result2.inputFile(relativePath).key())).isNull();
+ assertThat(result2.getReportComponent(result2.inputFile(FILE_PATH).key())).isNull();
+ assertThat(result2.getReportReader().readChangesets(fileId)).isNull();
+ assertThat(result2.getReportReader().hasCoverage(fileId)).isFalse();
+ assertThat(result.getReportReader().readFileSource(fileId)).isNull();
}
@Test
.properties(ImmutableMap.<String, String>builder()
.put("sonar.task", "scan")
.put("sonar.projectBaseDir", baseDir.getAbsolutePath())
- .put("sonar.projectKey", "sample")
+ .put("sonar.projectKey", PROJECT_KEY)
.put("sonar.sources", ".")
+ .put("sonar.scm.provider", "xoo")
.build())
.execute();
}
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
-import org.sonar.api.utils.PathUtils;
import org.sonar.api.utils.log.LogTester;
import org.sonar.scanner.mediumtest.ScannerMediumTester;
import org.sonar.scanner.mediumtest.ScannerMediumTester.TaskBuilder;
assertThat(fileWithoutBlameScm).isNull();
assertThat(logTester.logs()).containsSubsequence("2 files to be analyzed", "1/2 files analyzed", MISSING_BLAME_INFORMATION_FOR_THE_FOLLOWING_FILES,
- " * " + PathUtils.sanitize(xooFileWithoutBlame.toPath().toString()));
+ " * src/sample_no_blame.xoo");
}
// SONAR-6397
// 5 .xoo files + 3 .scm files, but only 4 marked for publishing. 1 file is SAME so not included in the total
assertThat(logTester.logs()).containsSubsequence("8 files indexed");
assertThat(logTester.logs()).containsSubsequence("4 files to be analyzed", "3/4 files analyzed");
- assertThat(logTester.logs()).containsSubsequence(MISSING_BLAME_INFORMATION_FOR_THE_FOLLOWING_FILES, " * " + noBlameScmOnServer.getPath().replaceAll("\\\\", "/"));
+ assertThat(logTester.logs()).containsSubsequence(MISSING_BLAME_INFORMATION_FOR_THE_FOLLOWING_FILES, " * src/no_blame_scm_on_server.xoo");
}
@Test
import org.sonar.api.config.internal.MapSettings;
import org.sonar.scanner.issue.IssueCache;
import org.sonar.scanner.issue.tracking.TrackedIssue;
+import org.sonar.scanner.scan.BranchConfiguration;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
import static org.assertj.core.api.Assertions.assertThat;
public void setUp() throws IOException {
issueCache = mock(IssueCache.class);
DefaultInputModule rootModule = TestInputFileBuilder.newDefaultInputModule("foo", temp.newFolder());
- componentStore = new InputComponentStore(rootModule, mock(AnalysisMode.class));
+ componentStore = new InputComponentStore(rootModule, mock(AnalysisMode.class), mock(BranchConfiguration.class));
settings = new MapSettings();
analysisMode = mock(AnalysisMode.class);
context = new DefaultPostJobContext(settings.asConfig(), settings, issueCache, componentStore, analysisMode);
@Test
public void skip_unchanged_components_in_short_branches() throws IOException {
- when(branchConfiguration.branchType()).thenReturn(BranchType.SHORT);
+ when(branchConfiguration.isShortLivingBranch()).thenReturn(true);
ProjectAnalysisInfo projectAnalysisInfo = mock(ProjectAnalysisInfo.class);
when(projectAnalysisInfo.analysisDate()).thenReturn(DateUtils.parseDate("2012-12-12"));
import org.sonar.scanner.protocol.output.ScannerReport.LineCoverage;
import org.sonar.scanner.protocol.output.ScannerReportReader;
import org.sonar.scanner.protocol.output.ScannerReportWriter;
+import org.sonar.scanner.scan.BranchConfiguration;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
import org.sonar.scanner.scan.measure.MeasureCache;
String moduleKey = "foo";
inputFile = new TestInputFileBuilder(moduleKey, "src/Foo.php").setLines(5).build();
DefaultInputModule rootModule = TestInputFileBuilder.newDefaultInputModule(moduleKey, temp.newFolder());
- InputComponentStore componentCache = new InputComponentStore(rootModule, mock(AnalysisMode.class));
+ InputComponentStore componentCache = new InputComponentStore(rootModule, mock(AnalysisMode.class), mock(BranchConfiguration.class));
componentCache.put(inputFile);
measureCache = mock(MeasureCache.class);
import org.sonar.scanner.protocol.output.ScannerReport;
import org.sonar.scanner.protocol.output.ScannerReportReader;
import org.sonar.scanner.protocol.output.ScannerReportWriter;
+import org.sonar.scanner.scan.BranchConfiguration;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
import org.sonar.scanner.scan.measure.MeasureCache;
String moduleKey = "foo";
inputModule = TestInputFileBuilder.newDefaultInputModule(moduleKey, temp.newFolder());
inputFile = new TestInputFileBuilder(moduleKey, "src/Foo.php").setPublish(true).build();
- InputComponentStore componentCache = new InputComponentStore(inputModule, mock(AnalysisMode.class));
+ InputComponentStore componentCache = new InputComponentStore(inputModule, mock(AnalysisMode.class), mock(BranchConfiguration.class));
componentCache.put(inputFile);
measureCache = mock(MeasureCache.class);
when(measureCache.byComponentKey(anyString())).thenReturn(Collections.<DefaultMeasure<?>>emptyList());
import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
import org.sonar.scanner.protocol.output.ScannerReportWriter;
+import org.sonar.scanner.scan.BranchConfiguration;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
import static org.assertj.core.api.Assertions.assertThat;
DefaultInputModule rootModule = TestInputFileBuilder.newDefaultInputModule(moduleKey, baseDir);
analysisMode = mock(AnalysisMode.class);
- InputComponentStore componentStore = new InputComponentStore(rootModule, analysisMode);
+ InputComponentStore componentStore = new InputComponentStore(rootModule, analysisMode, mock(BranchConfiguration.class));
componentStore.put(inputFile);
publisher = new SourcePublisher(componentStore);
private InputComponentStore componentStore;
public void createIndexer(DefaultInputModule rootModule) {
- componentStore = new InputComponentStore(rootModule, mock(AnalysisMode.class));
+ componentStore = new InputComponentStore(rootModule, mock(AnalysisMode.class), mock(BranchConfiguration.class));
tree = new DefaultComponentTree();
moduleHierarchy = mock(DefaultInputModuleHierarchy.class);
indexer = new ModuleIndexer(tree, componentStore, moduleHierarchy);
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
+import org.sonar.scanner.scan.BranchConfiguration;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
DefaultInputModule rootModule = TestInputFileBuilder.newDefaultInputModule(rootDef);
DefaultInputModule subModule = TestInputFileBuilder.newDefaultInputModule(moduleDef);
- InputComponentStore cache = new InputComponentStore(rootModule, mock(AnalysisMode.class));
+ InputComponentStore cache = new InputComponentStore(rootModule, mock(AnalysisMode.class), mock(BranchConfiguration.class));
cache.put(subModule);
DefaultInputFile fooFile = new TestInputFileBuilder(rootModuleKey, "src/main/java/Foo.java")
static class InputComponentStoreTester extends InputComponentStore {
InputComponentStoreTester() throws IOException {
- super(TestInputFileBuilder.newDefaultInputModule("root", temp.newFolder()), mock(AnalysisMode.class));
+ super(TestInputFileBuilder.newDefaultInputModule("root", temp.newFolder()), mock(AnalysisMode.class), mock(BranchConfiguration.class));
}
InputFile addFile(String moduleKey, String relpath, String language) {
import org.sonar.api.batch.fs.internal.DefaultInputModule;
import org.sonar.api.batch.fs.internal.SensorStrategy;
import org.sonar.api.batch.fs.internal.TestInputFileBuilder;
+import org.sonar.scanner.scan.BranchConfiguration;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
@Before
public void setUp() throws IOException {
DefaultInputModule root = TestInputFileBuilder.newDefaultInputModule(moduleKey, temp.newFolder());
- componentStore = new InputComponentStore(root, mock(AnalysisMode.class));
+ componentStore = new InputComponentStore(root, mock(AnalysisMode.class), mock(BranchConfiguration.class));
}
@Test
import org.sonar.api.rule.RuleKey;
import org.sonar.scanner.issue.IssueCache;
import org.sonar.scanner.issue.tracking.TrackedIssue;
+import org.sonar.scanner.scan.BranchConfiguration;
import org.sonar.scanner.scan.DefaultComponentTree;
import org.sonar.scanner.scan.filesystem.InputComponentStore;
DefaultComponentTree inputComponentTree = new DefaultComponentTree();
ProjectDefinition def = ProjectDefinition.create().setBaseDir(projectBaseDir).setWorkDir(temp.newFolder()).setKey("struts");
DefaultInputModule rootModule = new DefaultInputModule(def, 1);
- InputComponentStore inputComponentStore = new InputComponentStore(rootModule, mock(AnalysisMode.class));
+ InputComponentStore inputComponentStore = new InputComponentStore(rootModule, mock(AnalysisMode.class), mock(BranchConfiguration.class));
DefaultInputModule moduleA = new DefaultInputModule(ProjectDefinition.create().setKey("struts-core").setBaseDir(temp.newFolder()).setWorkDir(temp.newFolder()));
inputComponentTree.index(moduleA, rootModule);
@Test
public void shouldSkipDupsAndCoverageOnShortBranches() {
- when(branchConfig.branchType()).thenReturn(BranchConfiguration.BranchType.SHORT);
+ when(branchConfig.isShortLivingBranch()).thenReturn(true);
assertThat(adaptor.newCpdTokens()).isEqualTo(DefaultSensorContext.NO_OP_NEW_CPD_TOKENS);
assertThat(adaptor.newCoverage()).isEqualTo(DefaultSensorContext.NO_OP_NEW_COVERAGE);
}