use of org.sonarqube.ws.Favorites.SearchResponse in project sonarqube by SonarSource.
the class SearchActionTest method filter_authorized_components.
@Test
public void filter_authorized_components() {
OrganizationDto organizationDto = db.organizations().insert();
addComponent(newProjectDto(organizationDto).setKey("K1"));
ComponentDto unauthorizedProject = db.components().insertComponent(newProjectDto(organizationDto));
db.favorites().add(unauthorizedProject, USER_ID);
SearchResponse result = call();
assertThat(result.getFavoritesCount()).isEqualTo(1);
assertThat(result.getFavorites(0).getKey()).isEqualTo("K1");
}
use of org.sonarqube.ws.Favorites.SearchResponse in project sonarqube by SonarSource.
the class SearchAction method handle.
@Override
public void handle(Request request, Response response) throws Exception {
SearchRequest searchRequest = toWsRequest(request);
SearchResults searchResults = toSearchResults(searchRequest);
SearchResponse wsResponse = toSearchResponse(searchResults);
writeProtobuf(wsResponse, request, response);
}
Aggregations