Search in sources :

Example 6 with Param

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();
}
Also used : WebService(org.sonar.api.server.ws.WebService) Param(org.sonar.api.server.ws.WebService.Param) Test(org.junit.Test)

Example 7 with Param

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();
}
Also used : Action(org.sonar.api.server.ws.WebService.Action) Param(org.sonar.api.server.ws.WebService.Param) Test(org.junit.Test)

Example 8 with Param

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();
}
Also used : WebService(org.sonar.api.server.ws.WebService) Param(org.sonar.api.server.ws.WebService.Param) Test(org.junit.Test)

Example 9 with Param

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();
}
Also used : WebService(org.sonar.api.server.ws.WebService) Param(org.sonar.api.server.ws.WebService.Param) Test(org.junit.Test)

Example 10 with Param

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();
}
Also used : WebService(org.sonar.api.server.ws.WebService) Param(org.sonar.api.server.ws.WebService.Param) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)19 Param (org.sonar.api.server.ws.WebService.Param)19 WebService (org.sonar.api.server.ws.WebService)13 Action (org.sonar.api.server.ws.WebService.Action)4