/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/task">Further information about this action online (including a response example)</a> * @since 5.2 */ public TaskResponse task(TaskRequest request) { return call( new GetRequest(path("task")) .setParam("additionalFields", request.getAdditionalFields() == null ? null : request.getAdditionalFields().stream().collect(Collectors.joining(","))) .setParam("id", request.getId()), TaskResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/ce/component">Further information about this action online (including a response example)</a> * @since 5.2 */ public ComponentResponse component(ComponentRequest request) { return call( new GetRequest(path("component")) .setParam("component", request.getComponent()) .setParam("componentId", request.getComponentId()), ComponentResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/get_by_project">Further information about this action online (including a response example)</a> * @since 6.1 */ public GetByProjectResponse getByProject(GetByProjectRequest request) { return call( new GetRequest(path("get_by_project")) .setParam("organization", request.getOrganization()) .setParam("project", request.getProject()), GetByProjectResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/webhooks/list">Further information about this action online (including a response example)</a> * @since 7.1 */ public ListResponse list(ListRequest request) { return call( new GetRequest(path("list")) .setParam("organization", request.getOrganization()) .setParam("project", request.getProject()), ListResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/notifications/list">Further information about this action online (including a response example)</a> * @since 6.3 */ public ListResponse list(ListRequest request) { return call( new GetRequest(path("list")) .setParam("login", request.getLogin()), ListResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/list">Further information about this action online (including a response example)</a> * @since 4.3 */ public ListWsResponse list(ListRequest request) { return call( new GetRequest(path("list")) .setParam("organization", request.getOrganization()), ListWsResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches/list">Further information about this action online (including a response example)</a> * @since 6.6 */ public ListWsResponse list(ListRequest request) { return call( new GetRequest(path("list")) .setParam("project", request.getProject()), ListWsResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/settings/encrypt">Further information about this action online (including a response example)</a> * @since 6.1 */ public EncryptWsResponse encrypt(EncryptRequest request) { return call( new GetRequest(path("encrypt")) .setParam("value", request.getValue()), EncryptWsResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/webhooks/delivery">Further information about this action online (including a response example)</a> * @since 6.2 */ public DeliveryWsResponse delivery(DeliveryRequest request) { return call( new GetRequest(path("delivery")) .setParam("deliveryId", request.getDeliveryId()), DeliveryWsResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/issues/changelog">Further information about this action online (including a response example)</a> * @since 4.1 */ public ChangelogWsResponse changelog(ChangelogRequest request) { return call( new GetRequest(path("changelog")) .setParam("issue", request.getIssue()), ChangelogWsResponse.parser()); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/user_tokens/search">Further information about this action online (including a response example)</a> * @since 5.3 */ public SearchWsResponse search(SearchRequest request) { return call( new GetRequest(path("search")) .setParam("login", request.getLogin()), SearchWsResponse.parser()); } }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_pull_requests/list">Further information about this action online (including a response example)</a> * @since 7.1 */ public ListWsResponse list(ListRequest request) { return call( new GetRequest(path("list")) .setParam("project", request.getProject()), ListWsResponse.parser()); } }
public void test() { GetRequest get = new GetRequest(path("issue")).setParam("key", "ABC"); when(wsConnector.call(get)).thenReturn(newProtobufFakeResponse()); Testing.Fake message = call(get, Testing.Fake.parser()); assertThat(message.getLabel()).isEqualTo("ok"); assertThat(get.getPath()).isEqualTo("api/issues/issue"); // media type automatically set to protobuf assertThat(get.getMediaType()).isEqualTo(MediaTypes.PROTOBUF); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/views/local_views">Further information about this action online (including a response example)</a> * @since 1.0 */ public String localViews(LocalViewsRequest request) { return call( new GetRequest(path("local_views")) .setParam("key", request.getKey()) .setMediaType(MediaTypes.JSON) ).content(); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/navigation/organization">Further information about this action online (including a response example)</a> * @since 6.3 */ public String organization(OrganizationRequest request) { return call( new GetRequest(path("organization")) .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/rules/app">Further information about this action online (including a response example)</a> * @since 4.5 */ public String app(AppRequest request) { return call( new GetRequest(path("app")) .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/system/logs">Further information about this action online (including a response example)</a> * @since 5.2 */ public String logs(LogsRequest request) { return call( new GetRequest(path("logs")) .setParam("process", request.getProcess()) .setMediaType(MediaTypes.JSON) ).content(); }
/** * * This is part of the internal API. * This is a GET request. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/views/move_options">Further information about this action online (including a response example)</a> * @since 1.0 */ public String moveOptions(MoveOptionsRequest request) { return call( new GetRequest(path("move_options")) .setParam("key", request.getKey()) .setMediaType(MediaTypes.JSON) ).content(); }
public void test() { GetRequest get = new GetRequest(path("issue")).setParam("key", "ABC"); when(wsConnector.call(get)).thenReturn(MockWsResponse.createJson("{}").setRequestUrl("http://local/api/issues/issue?key=ABC")); try { call(get, Testing.Fake.parser()); fail(); } catch (IllegalStateException e) { assertThat(e).hasMessage("Fail to parse protobuf response of http://local/api/issues/issue?key=ABC"); } } }.test();
public void test() { GetRequest get = new GetRequest(path("issue")).setParam("key", "ABC"); when(wsConnector.call(get)).thenReturn(new MockWsResponse().setCode(403).setRequestUrl("https://local/foo").setContent("error")); try { call(get, Testing.Fake.parser()); fail(); } catch (HttpException e) { assertThat(e.code()).isEqualTo(403); } }