use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class AvailableActionTest method action_available_is_defined.
@Test
public void action_available_is_defined() {
logInAsSystemAdministrator();
WsTester wsTester = new WsTester();
WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
underTest.define(newController);
newController.done();
WebService.Controller controller = wsTester.controller(DUMMY_CONTROLLER_KEY);
assertThat(controller.actions()).extracting("key").containsExactly("available");
WebService.Action action = controller.actions().iterator().next();
assertThat(action.isPost()).isFalse();
assertThat(action.description()).isNotEmpty();
assertThat(action.responseExample()).isNotNull();
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class InstallActionTest method action_install_is_defined.
@Test
public void action_install_is_defined() {
logInAsSystemAdministrator();
WsTester wsTester = new WsTester();
WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
underTest.define(newController);
newController.done();
WebService.Controller controller = wsTester.controller(DUMMY_CONTROLLER_KEY);
assertThat(controller.actions()).extracting("key").containsExactly(ACTION_KEY);
WebService.Action action = controller.actions().iterator().next();
assertThat(action.isPost()).isTrue();
assertThat(action.description()).isNotEmpty();
assertThat(action.responseExample()).isNull();
assertThat(action.params()).hasSize(1);
WebService.Param keyParam = action.param(KEY_PARAM);
assertThat(keyParam).isNotNull();
assertThat(keyParam.isRequired()).isTrue();
assertThat(keyParam.description()).isNotNull();
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UninstallActionTest method action_uninstall_is_defined.
@Test
public void action_uninstall_is_defined() {
logInAsSystemAdministrator();
WsTester wsTester = new WsTester();
WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
underTest.define(newController);
newController.done();
WebService.Controller controller = wsTester.controller(DUMMY_CONTROLLER_KEY);
assertThat(controller.actions()).extracting("key").containsExactly(ACTION_KEY);
WebService.Action action = controller.actions().iterator().next();
assertThat(action.isPost()).isTrue();
assertThat(action.description()).isNotEmpty();
assertThat(action.responseExample()).isNull();
assertThat(action.params()).hasSize(1);
WebService.Param keyParam = action.param(KEY_PARAM);
assertThat(keyParam).isNotNull();
assertThat(keyParam.isRequired()).isTrue();
assertThat(keyParam.description()).isNotNull();
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UpdateActionTest method action_update_is_defined.
@Test
public void action_update_is_defined() {
logInAsSystemAdministrator();
WsTester wsTester = new WsTester();
WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
underTest.define(newController);
newController.done();
WebService.Controller controller = wsTester.controller(DUMMY_CONTROLLER_KEY);
assertThat(controller.actions()).extracting("key").containsExactly(ACTION_KEY);
WebService.Action action = controller.actions().iterator().next();
assertThat(action.isPost()).isTrue();
assertThat(action.description()).isNotEmpty();
assertThat(action.responseExample()).isNull();
assertThat(action.params()).hasSize(1);
WebService.Param key = action.param(KEY_PARAM);
assertThat(key).isNotNull();
assertThat(key.isRequired()).isTrue();
assertThat(key.description()).isNotNull();
}
use of org.sonar.server.ws.WsTester in project sonarqube by SonarSource.
the class UpdatesActionTest method action_updatable_is_defined.
@Test
public void action_updatable_is_defined() {
logInAsSystemAdministrator();
WsTester wsTester = new WsTester();
WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
underTest.define(newController);
newController.done();
WebService.Controller controller = wsTester.controller(DUMMY_CONTROLLER_KEY);
assertThat(controller.actions()).extracting("key").containsExactly("updates");
WebService.Action action = controller.actions().iterator().next();
assertThat(action.isPost()).isFalse();
assertThat(action.description()).isNotEmpty();
assertThat(action.responseExample()).isNotNull();
}
Aggregations