use of org.sonar.scanner.scm.ScmConfiguration in project sonarqube by SonarSource.
the class MetadataPublisherTest method createPublisher.
private void createPublisher(ProjectDefinition def) throws IOException {
Path rootBaseDir = temp.newFolder().toPath();
Path moduleBaseDir = rootBaseDir.resolve("moduleDir");
Files.createDirectory(moduleBaseDir);
DefaultInputModule rootModule = new DefaultInputModule(def.setBaseDir(rootBaseDir.toFile()).setKey("root").setWorkDir(temp.newFolder()), TestInputFileBuilder.nextBatchId());
InputModuleHierarchy inputModuleHierarchy = mock(InputModuleHierarchy.class);
when(inputModuleHierarchy.root()).thenReturn(rootModule);
DefaultInputModule child = new DefaultInputModule(ProjectDefinition.create().setKey("module").setBaseDir(moduleBaseDir.toFile()).setWorkDir(temp.newFolder()), TestInputFileBuilder.nextBatchId());
when(inputModuleHierarchy.children(rootModule)).thenReturn(Collections.singletonList(child));
when(inputModuleHierarchy.relativePathToRoot(child)).thenReturn("modulePath");
when(inputModuleHierarchy.relativePathToRoot(rootModule)).thenReturn("");
branches = mock(BranchConfiguration.class);
scmConfiguration = mock(ScmConfiguration.class);
when(scmConfiguration.provider()).thenReturn(scmProvider);
underTest = new MetadataPublisher(projectInfo, inputModuleHierarchy, qProfiles, cpdSettings, pluginRepository, branches, scmRevision, componentStore, scmConfiguration);
}
Aggregations