use of org.sonar.db.component.ProjectLinkDto in project sonarqube by SonarSource.
the class SearchActionTest method request_by_project_key.
@Test
public void request_by_project_key() {
ComponentDto project = db.components().insertPrivateProject();
ProjectLinkDto link = db.componentLinks().insertCustomLink(project);
logInAsProjectAdministrator(project);
SearchWsResponse response = callByKey(project.getKey());
assertThat(response.getLinksList()).extracting(Link::getId, Link::getName).containsExactlyInAnyOrder(tuple(link.getUuid(), link.getName()));
}
use of org.sonar.db.component.ProjectLinkDto in project sonarqube by SonarSource.
the class SearchAction method doHandle.
private SearchWsResponse doHandle(SearchRequest searchWsRequest) {
try (DbSession dbSession = dbClient.openSession(false)) {
ProjectDto project = getProjectByUuidOrKey(dbSession, searchWsRequest);
List<ProjectLinkDto> links = dbClient.projectLinkDao().selectByProjectUuid(dbSession, project.getUuid());
return buildResponse(links);
}
}
Aggregations