use of org.sonar.api.server.ws.WebService.Param in project sonarqube by SonarSource.
the class ComponentActionTest method definition.
@Test
public void definition() {
WebService.Action def = ws.getDef();
assertThat(def.since()).isEqualTo("5.4");
assertThat(def.params()).extracting(Param::key).containsExactlyInAnyOrder("component", "branch", "pullRequest", "metricKeys", "additionalFields");
WebService.Param component = def.param(PARAM_COMPONENT);
assertThat(component.isRequired()).isTrue();
WebService.Param branch = def.param("branch");
assertThat(branch.since()).isEqualTo("6.6");
assertThat(branch.isInternal()).isFalse();
assertThat(branch.isRequired()).isFalse();
}
use of org.sonar.api.server.ws.WebService.Param in project sonarqube by SonarSource.
the class SetTagsActionTest method test_definition.
@Test
public void test_definition() {
Action action = ws.getDef();
assertThat(action.description()).isNotEmpty();
assertThat(action.responseExampleAsString()).isNotEmpty();
assertThat(action.isPost()).isTrue();
assertThat(action.isInternal()).isFalse();
assertThat(action.params()).hasSize(2);
Param query = action.param("issue");
assertThat(query.isRequired()).isTrue();
assertThat(query.description()).isNotEmpty();
assertThat(query.exampleValue()).isNotEmpty();
Param pageSize = action.param("tags");
assertThat(pageSize.isRequired()).isFalse();
assertThat(pageSize.defaultValue()).isNull();
assertThat(pageSize.description()).isNotEmpty();
assertThat(pageSize.exampleValue()).isNotEmpty();
}
use of org.sonar.api.server.ws.WebService.Param in project sonarqube by SonarSource.
the class SearchHistoryActionTest method definition.
@Test
public void definition() {
WebService.Action definition = ws.getDef();
assertThat(definition.key()).isEqualTo("search_history");
assertThat(definition.responseExampleAsString()).isNotEmpty();
assertThat(definition.isPost()).isFalse();
assertThat(definition.isInternal()).isFalse();
assertThat(definition.since()).isEqualTo("6.3");
assertThat(definition.params()).hasSize(8);
Param branch = definition.param("branch");
assertThat(branch.since()).isEqualTo("6.6");
assertThat(branch.isInternal()).isFalse();
assertThat(branch.isRequired()).isFalse();
}
use of org.sonar.api.server.ws.WebService.Param in project sonarqube by SonarSource.
the class SearchActionTest method definition.
@Test
public void definition() {
WebService.Action definition = ws.getDef();
assertThat(definition.key()).isEqualTo("search");
assertThat(definition.since()).isEqualTo("6.3");
assertThat(definition.responseExampleAsString()).isNotEmpty();
assertThat(definition.param("project").isRequired()).isTrue();
assertThat(definition.param("category")).isNotNull();
assertThat(definition.params()).hasSize(7);
Param from = definition.param("from");
assertThat(from.since()).isEqualTo("6.5");
Param to = definition.param("to");
assertThat(to.since()).isEqualTo("6.5");
Param branch = definition.param("branch");
assertThat(branch.since()).isEqualTo("6.6");
assertThat(branch.isInternal()).isTrue();
assertThat(branch.isRequired()).isFalse();
}
use of org.sonar.api.server.ws.WebService.Param in project sonarqube by SonarSource.
the class RenameActionTest method definition.
@Test
public void definition() {
WebService.Action definition = ws.getDef();
assertThat(definition.key()).isEqualTo("rename");
assertThat(definition.isPost()).isTrue();
assertThat(definition.params()).extracting(Param::key).containsExactlyInAnyOrder("key", "name");
Param profile = definition.param("key");
assertThat(profile.deprecatedKey()).isNullOrEmpty();
}
Aggregations