use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class QualityProfilesServiceTest method search.
@Test
public void search() {
underTest.search(new SearchWsRequest().setDefaults(true).setProjectKey("project").setLanguage("language").setProfileName("profile"));
GetRequest getRequest = serviceTester.getGetRequest();
assertThat(serviceTester.getGetParser()).isSameAs(QualityProfiles.SearchWsResponse.parser());
serviceTester.assertThat(getRequest).hasParam(PARAM_DEFAULTS, true).hasParam(PARAM_PROJECT_KEY, "project").hasParam(PARAM_LANGUAGE, "language").hasParam(PARAM_PROFILE_NAME, "profile").andNoOtherParam();
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class RulesServiceTest method search.
@Test
public void search() {
underTest.search(new SearchWsRequest().setActivation(ACTIVATION_VALUE).setActiveSeverities(ACTIVE_SEVERITIES_VALUE).setAsc(ASC_VALUE).setAvailableSince(AVAILABLE_SINCE_VALUE).setFields(FIELDS_VALUE).setFacets(FACETS_VALUE).setInheritance(INHERITANCE_VALUE).setIsTemplate(IS_TEMPLATE_VALUE).setLanguages(LANGUAGES_VALUE).setPage(PAGE_VALUE).setPageSize(PAGE_SIZE_VALUE).setQuery(QUERY_VALUE).setQProfile(QPROFILE_VALUE).setRepositories(REPOSITORIES_VALUE).setRuleKey(RULE_KEY_VALUE).setSort(SORT_VALUE).setSeverities(SEVERITIES_VALUE).setStatuses(STATUSES_VALUE).setTags(TAGS_VALUE).setTemplateKey(TEMPLATE_KEY_VALUE).setTypes(TYPES_VALUE));
assertThat(serviceTester.getGetParser()).isSameAs(SearchResponse.parser());
GetRequest getRequest = serviceTester.getGetRequest();
serviceTester.assertThat(getRequest).hasPath("search").hasParam(PARAM_ACTIVATION, ACTIVATION_VALUE).hasParam(PARAM_ACTIVE_SEVERITIES, ACTIVE_SEVERITIES_VALUE_INLINED).hasParam("asc", ASC_VALUE).hasParam(PARAM_AVAILABLE_SINCE, AVAILABLE_SINCE_VALUE).hasParam("f", FIELDS_VALUE_INLINED).hasParam("facets", FACETS_VALUE_INLINED).hasParam(PARAM_INHERITANCE, INHERITANCE_VALUE_INLINED).hasParam(PARAM_IS_TEMPLATE, IS_TEMPLATE_VALUE).hasParam("p", PAGE_VALUE).hasParam("ps", PAGE_SIZE_VALUE).hasParam("q", QUERY_VALUE).hasParam(PARAM_QPROFILE, QPROFILE_VALUE).hasParam(PARAM_REPOSITORIES, REPOSITORIES_VALUE_INLINED).hasParam(PARAM_RULE_KEY, RULE_KEY_VALUE).hasParam(PARAM_LANGUAGES, LANGUAGES_VALUE_INLINED).hasParam("s", SORT_VALUE).hasParam(PARAM_SEVERITIES, SEVERITIES_VALUE_INLINED).hasParam(PARAM_STATUSES, STATUSES_VALUE_INLINED).hasParam(PARAM_TAGS, TAGS_VALUE_INLINED).hasParam(PARAM_TEMPLATE_KEY, TEMPLATE_KEY_VALUE).hasParam(PARAM_TYPES, TYPES_VALUE_INLINED).andNoOtherParam();
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class SettingsServiceTest method values.
@Test
public void values() {
underTest.values(ValuesRequest.builder().setKeys("sonar.debt,sonar.issue").setComponent("KEY").build());
GetRequest getRequest = serviceTester.getGetRequest();
assertThat(serviceTester.getGetParser()).isSameAs(ValuesWsResponse.parser());
serviceTester.assertThat(getRequest).hasParam(PARAM_KEYS, "sonar.debt,sonar.issue").hasParam(PARAM_COMPONENT, "KEY").andNoOtherParam();
}
use of org.sonarqube.ws.client.GetRequest in project sonarqube by SonarSource.
the class UpgradeTest method checkUrlIsReturningNotFound.
private void checkUrlIsReturningNotFound(String url) {
WsResponse response = newWsClient(orchestrator).wsConnector().call(new GetRequest(url));
assertThat(response.code()).isEqualTo(HttpURLConnection.HTTP_NOT_FOUND);
}
use of org.sonarqube.ws.client.GetRequest in project sonar-scanner-jenkins by SonarSource.
the class HttpClient method getHttp.
public String getHttp(String url, @Nullable String token) {
String baseUrl = StringUtils.substringBeforeLast(url, "/");
String path = StringUtils.substringAfterLast(url, "/");
HttpConnector httpConnector = HttpConnector.newBuilder().userAgent("Scanner for Jenkins").url(baseUrl).credentials(token, null).build();
WsResponse response = httpConnector.call(new GetRequest(path));
response.failIfNotSuccessful();
return response.content();
}
Aggregations