use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class QualityGatesServiceTest method associate_project.
@Test
public void associate_project() {
underTest.associateProject(new SelectWsRequest().setGateId(GATE_ID_VALUE).setProjectId(PROJECT_ID_VALUE).setProjectKey(PROJECT_KEY_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("select").hasParam(PARAM_GATE_ID, String.valueOf(GATE_ID_VALUE)).hasParam(PARAM_PROJECT_ID, String.valueOf(PROJECT_ID_VALUE)).hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE).andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class QualityGatesServiceTest method update_condition.
@Test
public void update_condition() {
underTest.updateCondition(UpdateConditionRequest.builder().setConditionId(10).setMetricKey("metric").setOperator("LT").setWarning("warning").setError("error").setPeriod(1).build());
PostRequest request = serviceTester.getPostRequest();
assertThat(serviceTester.getPostParser()).isSameAs(UpdateConditionWsResponse.parser());
serviceTester.assertThat(request).hasPath("update_condition").hasParam(PARAM_ID, 10).hasParam(PARAM_METRIC, "metric").hasParam(PARAM_OPERATOR, "LT").hasParam(PARAM_WARNING, "warning").hasParam(PARAM_ERROR, "error").hasParam(PARAM_PERIOD, 1).andNoOtherParam();
}
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();
}
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);
}
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);
}
Aggregations