Search in sources :

Example 21 with SearchProjectsWsResponse

use of org.sonarqube.ws.WsComponents.SearchProjectsWsResponse in project sonarqube by SonarSource.

the class SearchProjectsActionTest method empty_list_if_isFavorite_filter_and_anonymous_user.

@Test
public void empty_list_if_isFavorite_filter_and_anonymous_user() {
    insertProjectInDbAndEs(newProjectDto(db.getDefaultOrganization()).setName("Sonar Java"), newArrayList(newMeasure(COVERAGE, 81)));
    insertMetrics(COVERAGE);
    userSession.anonymous();
    request.setFilter("isFavorite");
    SearchProjectsWsResponse result = call(request);
    assertThat(result.getComponentsCount()).isEqualTo(0);
}
Also used : SearchProjectsWsResponse(org.sonarqube.ws.WsComponents.SearchProjectsWsResponse) Test(org.junit.Test)

Aggregations

SearchProjectsWsResponse (org.sonarqube.ws.WsComponents.SearchProjectsWsResponse)21 Test (org.junit.Test)20 OrganizationDto (org.sonar.db.organization.OrganizationDto)12 Common (org.sonarqube.ws.Common)6 ComponentDto (org.sonar.db.component.ComponentDto)4 Date (java.util.Date)1