Search in sources :

Example 11 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class QualityGatesServiceTest method create_condition.

@Test
public void create_condition() {
    underTest.createCondition(CreateConditionRequest.builder().setQualityGateId(10).setMetricKey("metric").setOperator("LT").setWarning("warning").setError("error").setPeriod(1).build());
    PostRequest request = serviceTester.getPostRequest();
    assertThat(serviceTester.getPostParser()).isSameAs(CreateConditionWsResponse.parser());
    serviceTester.assertThat(request).hasPath("create_condition").hasParam(PARAM_GATE_ID, 10).hasParam(PARAM_METRIC, "metric").hasParam(PARAM_OPERATOR, "LT").hasParam(PARAM_WARNING, "warning").hasParam(PARAM_ERROR, "error").hasParam(PARAM_PERIOD, 1).andNoOtherParam();
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest) Test(org.junit.Test)

Example 12 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class FavoritesService method remove.

public void remove(String component) {
    PostRequest post = new PostRequest(path(ACTION_REMOVE)).setParam(PARAM_COMPONENT, component);
    call(post);
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest)

Example 13 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class FavoritesService method add.

public void add(String component) {
    PostRequest post = new PostRequest(path(ACTION_ADD)).setParam(PARAM_COMPONENT, component);
    call(post);
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest)

Example 14 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class OrganizationService method delete.

public void delete(@Nullable String key) {
    PostRequest post = new PostRequest(path("delete")).setParam("key", key);
    call(post).failIfNotSuccessful();
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest)

Example 15 with PostRequest

use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.

the class RootsService method unsetRoot.

public void unsetRoot(String login) {
    PostRequest post = new PostRequest(path("unset_root")).setParam("login", login);
    call(post);
}
Also used : PostRequest(org.sonarqube.ws.client.PostRequest)

Aggregations

PostRequest (org.sonarqube.ws.client.PostRequest)44 Test (org.junit.Test)33 MimeMessage (javax.mail.internet.MimeMessage)2 Before (org.junit.Before)2 WsClient (org.sonarqube.ws.client.WsClient)2 WsResponse (org.sonarqube.ws.client.WsResponse)2 WiserMessage (org.subethamail.wiser.WiserMessage)2 ItUtils.newAdminWsClient (util.ItUtils.newAdminWsClient)2 ItUtils.newUserWsClient (util.ItUtils.newUserWsClient)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 SonarScanner (com.sonar.orchestrator.build.SonarScanner)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 BeforeClass (org.junit.BeforeClass)1 ProjectDefinition (org.sonar.api.batch.bootstrap.ProjectDefinition)1 MessageException (org.sonar.api.utils.MessageException)1 QualityGate (org.sonar.wsclient.qualitygate.QualityGate)1 HttpException (org.sonarqube.ws.client.HttpException)1 Wiser (org.subethamail.wiser.Wiser)1 ProjectsPage (pageobjects.projects.ProjectsPage)1