Search in sources :

Example 11 with ShowWSResponse

use of org.sonarqube.ws.NewCodePeriods.ShowWSResponse in project sonarqube by SonarSource.

the class ShowActionTest method show_inherited_if_branch_not_found.

@Test
public void show_inherited_if_branch_not_found() {
    ComponentDto project = componentDb.insertPublicProject();
    logInAsProjectScan(project);
    tester.insert(project.projectUuid(), NewCodePeriodType.NUMBER_OF_DAYS, "3");
    ShowWSResponse response = ws.newRequest().setParam("project", project.getKey()).setParam("branch", "unknown").executeProtobuf(ShowWSResponse.class);
    assertResponse(response, project.getKey(), "", NewCodePeriods.NewCodePeriodType.NUMBER_OF_DAYS, "3", true);
}
Also used : ShowWSResponse(org.sonarqube.ws.NewCodePeriods.ShowWSResponse) ComponentDto(org.sonar.db.component.ComponentDto) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 ShowWSResponse (org.sonarqube.ws.NewCodePeriods.ShowWSResponse)11 NewCodePeriodDto (org.sonar.db.newcodeperiod.NewCodePeriodDto)10 ComponentDto (org.sonar.db.component.ComponentDto)9 SnapshotDto (org.sonar.db.component.SnapshotDto)3 ListWSResponse (org.sonarqube.ws.NewCodePeriods.ListWSResponse)3 Instant (java.time.Instant)2 Optional (java.util.Optional)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 Assertions.assertThatThrownBy (org.assertj.core.api.Assertions.assertThatThrownBy)2 Rule (org.junit.Rule)2 WebService (org.sonar.api.server.ws.WebService)2 DateUtils (org.sonar.api.utils.DateUtils)2 System2 (org.sonar.api.utils.System2)2 UserRole (org.sonar.api.web.UserRole)2 UuidFactoryFast (org.sonar.core.util.UuidFactoryFast)2 DbClient (org.sonar.db.DbClient)2 DbTester (org.sonar.db.DbTester)2 BranchType (org.sonar.db.component.BranchType)2 ComponentDbTester (org.sonar.db.component.ComponentDbTester)2