Search in sources :

Example 26 with SearchWsResponse

use of org.sonarqube.ws.QualityProfiles.SearchWsResponse in project sonarqube by SonarSource.

the class SearchActionTest method empty_when_no_language_installed.

@Test
public void empty_when_no_language_installed() {
    WsActionTester ws = new WsActionTester(new SearchAction(userSession, new Languages(), dbClient, new ComponentFinder(dbClient, null)));
    db.qualityProfiles().insert();
    SearchWsResponse result = call(ws.newRequest());
    assertThat(result.getProfilesList()).isEmpty();
}
Also used : ComponentFinder(org.sonar.server.component.ComponentFinder) Languages(org.sonar.api.resources.Languages) SearchWsResponse(org.sonarqube.ws.Qualityprofiles.SearchWsResponse) WsActionTester(org.sonar.server.ws.WsActionTester) Test(org.junit.Test)

Example 27 with SearchWsResponse

use of org.sonarqube.ws.QualityProfiles.SearchWsResponse in project sonarqube by SonarSource.

the class SearchAction method handle.

@Override
public void handle(Request request, Response response) throws Exception {
    SearchWsResponse searchWsResponse = doHandle(toSearchWsRequest(request));
    writeProtobuf(searchWsResponse, request, response);
}
Also used : SearchWsResponse(org.sonarqube.ws.Qualityprofiles.SearchWsResponse)

Aggregations

Test (org.junit.Test)21 SearchWsResponse (org.sonarqube.ws.Qualityprofiles.SearchWsResponse)21 QProfileDto (org.sonar.db.qualityprofile.QProfileDto)16 QualityProfile (org.sonarqube.ws.Qualityprofiles.SearchWsResponse.QualityProfile)14 ProjectDto (org.sonar.db.project.ProjectDto)9 Languages (org.sonar.api.resources.Languages)6 ComponentFinder (org.sonar.server.component.ComponentFinder)6 WsActionTester (org.sonar.server.ws.WsActionTester)6 SearchWsResponse (org.sonarqube.ws.QualityProfiles.SearchWsResponse)6 List (java.util.List)5 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)5 Assertions.tuple (org.assertj.core.api.Assertions.tuple)5 Rule (org.junit.Rule)5 QualityProfileTesting.newQualityProfileDto (org.sonar.db.qualityprofile.QualityProfileTesting.newQualityProfileDto)5 IOException (java.io.IOException)4 InputStream (java.io.InputStream)4 IntStream.range (java.util.stream.IntStream.range)4 Assertions.assertThatThrownBy (org.assertj.core.api.Assertions.assertThatThrownBy)4 Language (org.sonar.api.resources.Language)4 DEPRECATED (org.sonar.api.rule.RuleStatus.DEPRECATED)4