use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class IssuesServiceTest method set_severity.
@Test
public void set_severity() {
underTest.setSeverity(new SetSeverityRequest("ABCD", "confirm"));
PostRequest request = serviceTester.getPostRequest();
assertThat(serviceTester.getPostParser()).isSameAs(Issues.Operation.parser());
serviceTester.assertThat(request).hasParam("issue", "ABCD").hasParam("severity", "confirm").andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class IssuesServiceTest method edit_comment.
@Test
public void edit_comment() {
underTest.editComment(new EditCommentRequest("ABCD", "Please help me to fix this issue"));
PostRequest request = serviceTester.getPostRequest();
assertThat(serviceTester.getPostParser()).isSameAs(Issues.Operation.parser());
serviceTester.assertThat(request).hasParam("comment", "ABCD").hasParam("text", "Please help me to fix this issue").andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class PermissionsServiceTest method removeGroupFromTemplate_does_POST_on_Ws_remove_group_from_template.
@Test
public void removeGroupFromTemplate_does_POST_on_Ws_remove_group_from_template() {
underTest.removeGroupFromTemplate(new RemoveGroupFromTemplateWsRequest().setPermission(PERMISSION_VALUE).setGroupId(GROUP_ID_VALUE).setGroupName(GROUP_NAME_VALUE).setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("remove_group_from_template").hasParam(PARAM_PERMISSION, PERMISSION_VALUE).hasParam(PARAM_GROUP_ID, GROUP_ID_VALUE).hasParam(PARAM_GROUP_NAME, GROUP_NAME_VALUE).hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE).hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE).andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class PermissionsServiceTest method deleteTemplate_does_POST_on_Ws_delete_template.
@Test
public void deleteTemplate_does_POST_on_Ws_delete_template() {
underTest.deleteTemplate(new DeleteTemplateWsRequest().setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("delete_template").hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE).hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE).andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class PermissionsServiceTest method updateTemplate_does_POST_on_Ws_update_template.
@Test
public void updateTemplate_does_POST_on_Ws_update_template() {
underTest.updateTemplate(new UpdateTemplateWsRequest().setDescription(DESCRIPTION_VALUE).setId(TEMPLATE_ID_VALUE).setName(TEMPLATE_NAME_VALUE).setProjectKeyPattern(PROJECT_KEY_PATTERN_VALUE));
assertThat(serviceTester.getPostParser()).isSameAs(WsPermissions.UpdateTemplateWsResponse.parser());
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("update_template").hasParam(PARAM_DESCRIPTION, DESCRIPTION_VALUE).hasParam(PARAM_ID, TEMPLATE_ID_VALUE).hasParam(PARAM_NAME, TEMPLATE_NAME_VALUE).hasParam(PARAM_PROJECT_KEY_PATTERN, PROJECT_KEY_PATTERN_VALUE).andNoOtherParam();
}
Aggregations