use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class IssuesServiceTest method do_transition.
@Test
public void do_transition() {
underTest.doTransition(new DoTransitionRequest("ABCD", "confirm"));
PostRequest request = serviceTester.getPostRequest();
assertThat(serviceTester.getPostParser()).isSameAs(Issues.Operation.parser());
serviceTester.assertThat(request).hasParam("issue", "ABCD").hasParam("transition", "confirm").andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class PermissionsServiceTest method applyTemplate_does_POST_on_Ws_apply_template.
@Test
public void applyTemplate_does_POST_on_Ws_apply_template() {
underTest.applyTemplate(new ApplyTemplateWsRequest().setProjectId(PROJECT_ID_VALUE).setProjectKey(PROJECT_KEY_VALUE).setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("apply_template").hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE).hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_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 addGroup_does_POST_on_Ws_add_group.
@Test
public void addGroup_does_POST_on_Ws_add_group() {
underTest.addGroup(new AddGroupWsRequest().setPermission(PERMISSION_VALUE).setProjectId(PROJECT_ID_VALUE).setProjectKey(PROJECT_KEY_VALUE).setGroupId(GROUP_ID_VALUE).setGroupName(GROUP_NAME_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("add_group").hasParam(PARAM_PERMISSION, PERMISSION_VALUE).hasParam(PARAM_PROJECT_ID, PROJECT_ID_VALUE).hasParam(PARAM_PROJECT_KEY, PROJECT_KEY_VALUE).hasParam(PARAM_GROUP_ID, GROUP_ID_VALUE).hasParam(PARAM_GROUP_NAME, GROUP_NAME_VALUE).andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class PermissionsServiceTest method removeGroup_does_POST_on_Ws_remove_group.
@Test
public void removeGroup_does_POST_on_Ws_remove_group() {
underTest.removeGroup(new RemoveGroupWsRequest().setPermission(PERMISSION_VALUE).setGroupId(GROUP_ID_VALUE).setGroupName(GROUP_NAME_VALUE).setProjectId(PROJECT_ID_VALUE).setProjectKey(PROJECT_KEY_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("remove_group").hasParam(PARAM_PERMISSION, PERMISSION_VALUE).hasParam(PARAM_GROUP_ID, GROUP_ID_VALUE).hasParam(PARAM_GROUP_NAME, GROUP_NAME_VALUE).hasParam(PARAM_PROJECT_ID, 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 PermissionsServiceTest method remove_project_creator_from_template.
@Test
public void remove_project_creator_from_template() {
underTest.removeProjectCreatorFromTemplate(RemoveProjectCreatorFromTemplateWsRequest.builder().setPermission(PERMISSION_VALUE).setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE).build());
assertThat(serviceTester.getPostParser()).isNull();
PostRequest getRequest = serviceTester.getPostRequest();
serviceTester.assertThat(getRequest).hasPath("remove_project_creator_from_template").hasParam(PARAM_PERMISSION, PERMISSION_VALUE).hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE).hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE).andNoOtherParam();
}
Aggregations