use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class PermissionsServiceTest method bulk_apply_template.
@Test
public void bulk_apply_template() {
underTest.bulkApplyTemplate(new BulkApplyTemplateWsRequest().setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE).setQualifier(QUALIFIER_VALUE).setQuery(QUERY_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("bulk_apply_template").hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE).hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE).hasParam("q", QUERY_VALUE).hasParam(PARAM_QUALIFIER, QUALIFIER_VALUE).andNoOtherParam();
}
use of org.sonarqube.ws.client.PostRequest in project sonarqube by SonarSource.
the class PermissionsServiceTest method removeUserFromTemplate_does_POST_on_Ws_remove_user_from_template.
@Test
public void removeUserFromTemplate_does_POST_on_Ws_remove_user_from_template() {
underTest.removeUserFromTemplate(new RemoveUserFromTemplateWsRequest().setPermission(PERMISSION_VALUE).setLogin(LOGIN_VALUE).setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("remove_user_from_template").hasParam(PARAM_PERMISSION, PERMISSION_VALUE).hasParam(PARAM_USER_LOGIN, LOGIN_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 add_project_creator_to_template.
@Test
public void add_project_creator_to_template() {
underTest.addProjectCreatorToTemplate(AddProjectCreatorToTemplateWsRequest.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("add_project_creator_to_template").hasParam(PARAM_PERMISSION, PERMISSION_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 addUserToTemplate_does_POST_on_Ws_add_user_to_template.
@Test
public void addUserToTemplate_does_POST_on_Ws_add_user_to_template() {
underTest.addUserToTemplate(new AddUserToTemplateWsRequest().setPermission(PERMISSION_VALUE).setLogin(LOGIN_VALUE).setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("add_user_to_template").hasParam(PARAM_PERMISSION, PERMISSION_VALUE).hasParam(PARAM_USER_LOGIN, LOGIN_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 addGroupToTemplate_does_POST_on_Ws_add_group_to_template.
@Test
public void addGroupToTemplate_does_POST_on_Ws_add_group_to_template() {
underTest.addGroupToTemplate(new AddGroupToTemplateWsRequest().setGroupId(GROUP_ID_VALUE).setGroupName(GROUP_NAME_VALUE).setPermission(PERMISSION_VALUE).setTemplateId(TEMPLATE_ID_VALUE).setTemplateName(TEMPLATE_NAME_VALUE));
assertThat(serviceTester.getPostParser()).isNull();
PostRequest postRequest = serviceTester.getPostRequest();
serviceTester.assertThat(postRequest).hasPath("add_group_to_template").hasParam(PARAM_GROUP_ID, GROUP_ID_VALUE).hasParam(PARAM_GROUP_NAME, GROUP_NAME_VALUE).hasParam(PARAM_PERMISSION, PERMISSION_VALUE).hasParam(PARAM_TEMPLATE_ID, TEMPLATE_ID_VALUE).hasParam(PARAM_TEMPLATE_NAME, TEMPLATE_NAME_VALUE).andNoOtherParam();
}
Aggregations