use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class AddGroupToTemplateActionTest method newRequest.
private void newRequest(@Nullable String groupName, @Nullable String templateKey, @Nullable String permission) throws Exception {
TestRequest request = newRequest();
if (groupName != null) {
request.setParam(PARAM_GROUP_NAME, groupName);
}
if (templateKey != null) {
request.setParam(PARAM_TEMPLATE_ID, templateKey);
}
if (permission != null) {
request.setParam(PARAM_PERMISSION, permission);
}
request.execute();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class RemoveGroupFromTemplateActionTest method newRequest.
private void newRequest(@Nullable String groupName, @Nullable String templateKey, @Nullable String permission) throws Exception {
TestRequest request = newRequest();
if (groupName != null) {
request.setParam(PARAM_GROUP_NAME, groupName);
}
if (templateKey != null) {
request.setParam(PARAM_TEMPLATE_ID, templateKey);
}
if (permission != null) {
request.setParam(PARAM_PERMISSION, permission);
}
request.execute();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class RemoveUserFromTemplateActionTest method newRequest.
private void newRequest(@Nullable String userLogin, @Nullable String templateKey, @Nullable String permission) throws Exception {
TestRequest request = newRequest();
if (userLogin != null) {
request.setParam(PARAM_USER_LOGIN, userLogin);
}
if (templateKey != null) {
request.setParam(org.sonarqube.ws.client.permission.PermissionsWsParameters.PARAM_TEMPLATE_ID, templateKey);
}
if (permission != null) {
request.setParam(PARAM_PERMISSION, permission);
}
request.execute();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class IndexActionTest method call.
private String call(@Nullable String key, @Nullable String search, @Nullable Boolean subprojects) {
TestRequest httpRequest = ws.newRequest();
setNullable(key, e -> httpRequest.setParam("key", e));
setNullable(search, e -> httpRequest.setParam("search", e));
setNullable(subprojects, e -> httpRequest.setParam("subprojects", Boolean.toString(e)));
return httpRequest.execute().getInput();
}
use of org.sonar.server.ws.TestRequest in project sonarqube by SonarSource.
the class ProvisionedActionTest method fail_with_NotFoundException_when_organization_with_specified_key_does_not_exist.
@Test
public void fail_with_NotFoundException_when_organization_with_specified_key_does_not_exist() {
TestRequest request = underTest.newRequest().setParam(PARAM_ORGANIZATION, "foo");
userSessionRule.logIn();
expectedException.expect(NotFoundException.class);
expectedException.expectMessage("No organization for key 'foo'");
request.execute();
}
Aggregations