use of org.sonar.db.newcodeperiod.NewCodePeriodDto in project sonarqube by SonarSource.
the class ShowActionTest method show_inherited_branch_setting_from_project.
@Test
public void show_inherited_branch_setting_from_project() {
ComponentDto project = componentDb.insertPublicProject();
logInAsProjectAdministrator(project);
ComponentDto branch = componentDb.insertProjectBranch(project, b -> b.setKey("branch"));
tester.insert(new NewCodePeriodDto().setProjectUuid(project.uuid()).setType(NewCodePeriodType.NUMBER_OF_DAYS).setValue("1"));
ShowWSResponse response = ws.newRequest().setParam("project", project.getKey()).setParam("branch", "branch").executeProtobuf(ShowWSResponse.class);
assertResponse(response, project.getKey(), "branch", NewCodePeriods.NewCodePeriodType.NUMBER_OF_DAYS, "1", true);
}
use of org.sonar.db.newcodeperiod.NewCodePeriodDto in project sonarqube by SonarSource.
the class SetBaselineActionTest method set_baseline_on_non_main_branch.
@Test
public void set_baseline_on_non_main_branch() {
ComponentDto project = tester.insertPrivateProject();
ComponentDto branchComponent = tester.insertProjectBranch(project);
SnapshotDto analysis = db.components().insertSnapshot(branchComponent);
BranchDto branch = branchDao.selectByUuid(dbSession, branchComponent.uuid()).get();
logInAsProjectAdministrator(project);
call(project.getKey(), branch.getKey(), analysis.getUuid());
NewCodePeriodDto loaded = dbClient.newCodePeriodDao().selectByBranch(dbSession, project.uuid(), branch.getUuid()).get();
assertThat(loaded.getValue()).isEqualTo(analysis.getUuid());
assertThat(loaded.getType()).isEqualTo(SPECIFIC_ANALYSIS);
}
Aggregations