use of org.sonar.ce.task.projectanalysis.component.DefaultBranchImpl in project sonarqube by SonarSource.
the class AnalysisMetadataHolderImplTest method set_branch.
@Test
public void set_branch() {
AnalysisMetadataHolderImpl underTest = new AnalysisMetadataHolderImpl(editionProvider);
underTest.setBranch(new DefaultBranchImpl());
assertThat(underTest.getBranch().getName()).isEqualTo("master");
}
use of org.sonar.ce.task.projectanalysis.component.DefaultBranchImpl in project sonarqube by SonarSource.
the class AnalysisMetadataHolderImplTest method setBranch_throws_ISE_when_called_twice.
@Test
public void setBranch_throws_ISE_when_called_twice() {
AnalysisMetadataHolderImpl underTest = new AnalysisMetadataHolderImpl(editionProvider);
underTest.setBranch(new DefaultBranchImpl());
assertThatThrownBy(() -> underTest.setBranch(new DefaultBranchImpl())).isInstanceOf(IllegalStateException.class).hasMessage("Branch has already been set");
}
use of org.sonar.ce.task.projectanalysis.component.DefaultBranchImpl in project sonarqube by SonarSource.
the class ProjectConfigurationFactoryTest method return_global_settings.
@Test
public void return_global_settings() {
settings.setProperty("key", "value");
Configuration config = underTest.newProjectConfiguration(PROJECT_KEY, new DefaultBranchImpl());
assertThat(config.get("key")).hasValue("value");
}
use of org.sonar.ce.task.projectanalysis.component.DefaultBranchImpl in project sonarqube by SonarSource.
the class ProjectConfigurationFactoryTest method return_project_settings.
@Test
public void return_project_settings() {
ComponentDto project = db.components().insertPrivateProject();
db.properties().insertProperties(null, project.getKey(), project.name(), project.qualifier(), newComponentPropertyDto(project).setKey("1").setValue("val1"), newComponentPropertyDto(project).setKey("2").setValue("val2"), newComponentPropertyDto(project).setKey("3").setValue("val3"));
Configuration config = underTest.newProjectConfiguration(project.getDbKey(), new DefaultBranchImpl());
assertThat(config.get("1")).hasValue("val1");
assertThat(config.get("2")).hasValue("val2");
assertThat(config.get("3")).hasValue("val3");
}
use of org.sonar.ce.task.projectanalysis.component.DefaultBranchImpl in project sonarqube by SonarSource.
the class ReportPersistComponentsStepTest method prepareProject.
private ComponentDto prepareProject(Consumer<ComponentDto> populators) {
ComponentDto dto = db.components().insertPrivateProject(populators);
analysisMetadataHolder.setProject(Project.from(dto));
analysisMetadataHolder.setBranch(new DefaultBranchImpl());
return dto;
}
Aggregations