use of org.sonarqube.ws.ProjectBranches.ListWsResponse in project sonarqube by SonarSource.
the class ListActionTest method test_project_with_branches.
@Test
public void test_project_with_branches() {
ComponentDto project = db.components().insertPrivateProject();
db.components().insertProjectBranch(project, b -> b.setKey("feature/bar"));
db.components().insertProjectBranch(project, b -> b.setKey("feature/foo"));
userSession.logIn().addProjectPermission(USER, project);
ListWsResponse response = ws.newRequest().setParam("project", project.getDbKey()).executeProtobuf(ListWsResponse.class);
assertThat(response.getBranchesList()).extracting(Branch::getName, Branch::getType).containsExactlyInAnyOrder(tuple("master", BranchType.BRANCH), tuple("feature/foo", BranchType.BRANCH), tuple("feature/bar", BranchType.BRANCH));
}
Aggregations