Codota Logo
WebService$Action.responseExample
Code IndexAdd Codota to your IDE (free)

How to use
responseExample
method
in
org.sonar.api.server.ws.WebService$Action

Best Java code snippets using org.sonar.api.server.ws.WebService$Action.responseExample (Showing top 20 results out of 315)

  • Common ways to obtain WebService$Action
private void myMethod () {
WebService$Action w =
  • Codota IconWebService.Controller webServiceController;String actionKey;webServiceController.action(actionKey)
  • Smart code suggestions by Codota
}
origin: SonarSource/sonarqube

@Test
public void define_delete_action() {
 WebService.Action action = ws.getDef();
 assertThat(action).isNotNull();
 assertThat(action.isPost()).isTrue();
 assertThat(action.handler()).isNotNull();
 assertThat(action.responseExample()).isNull();
 assertThat(action.params()).hasSize(1);
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action action = tester.getDef();
 assertThat(action.key()).isEqualTo("edit_comment");
 assertThat(action.isPost()).isTrue();
 assertThat(action.isInternal()).isFalse();
 assertThat(action.params()).hasSize(2);
 assertThat(action.responseExample()).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action action = tester.getDef();
 assertThat(action.key()).isEqualTo("changelog");
 assertThat(action.isPost()).isFalse();
 assertThat(action.isInternal()).isFalse();
 assertThat(action.params()).hasSize(1);
 assertThat(action.responseExample()).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void response_example() {
 MetricWs metricWs = new MetricWs();
 metricWs.define(context);
 WebService.Action action = context.controller("api/metric").action("create");
 assertThat(action.responseExampleFormat()).isEqualTo("txt");
 assertThat(action.responseExample()).isNotNull();
 assertThat(StringUtils.trim(action.responseExampleAsString())).isEqualTo("example of WS response");
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action action = tester.getDef();
 assertThat(action.key()).isEqualTo("set_severity");
 assertThat(action.isPost()).isTrue();
 assertThat(action.isInternal()).isFalse();
 assertThat(action.params()).hasSize(2);
 assertThat(action.responseExample()).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void verify_definition() {
 WebService.Action definition = underTest.getDef();
 assertThat(definition.key()).isEqualTo("health");
 assertThat(definition.isPost()).isFalse();
 assertThat(definition.description()).isNotEmpty();
 assertThat(definition.since()).isEqualTo("6.6");
 assertThat(definition.isInternal()).isFalse();
 assertThat(definition.responseExample()).isNotNull();
 assertThat(definition.params()).isEmpty();
}
origin: SonarSource/sonarqube

@Test
public void verify_definition() {
 WebService.Action definition = underTest.getDef();
 assertThat(definition.key()).isEqualTo("health");
 assertThat(definition.isPost()).isFalse();
 assertThat(definition.description()).isNotEmpty();
 assertThat(definition.since()).isEqualTo("6.6");
 assertThat(definition.isInternal()).isFalse();
 assertThat(definition.responseExample()).isNotNull();
 assertThat(definition.params()).isEmpty();
}
origin: SonarSource/sonarqube

@Test
public void action_installed_is_defined() {
 Action action = tester.getDef();
 assertThat(action.isPost()).isFalse();
 assertThat(action.description()).isNotEmpty();
 assertThat(action.responseExample()).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action action = tester.getDef();
 assertThat(action.key()).isEqualTo("set_type");
 assertThat(action.isPost()).isTrue();
 assertThat(action.isInternal()).isFalse();
 assertThat(action.params()).hasSize(2);
 assertThat(action.responseExample()).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action action = tester.getDef();
 assertThat(action.key()).isEqualTo("delete_comment");
 assertThat(action.isPost()).isTrue();
 assertThat(action.isInternal()).isFalse();
 assertThat(action.params()).hasSize(1);
 assertThat(action.responseExample()).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void action_updates_is_defined() {
 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("upgrades");
 WebService.Action action = controller.actions().iterator().next();
 assertThat(action.isPost()).isFalse();
 assertThat(action.description()).isNotEmpty();
 assertThat(action.responseExample()).isNotNull();
 assertThat(action.params()).isEmpty();
}
origin: SonarSource/sonarqube

@Test
public void action_pending_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("pending");
 WebService.Action action = controller.actions().iterator().next();
 assertThat(action.isPost()).isFalse();
 assertThat(action.description()).isNotEmpty();
 assertThat(action.responseExample()).isNotNull();
}
origin: SonarSource/sonarqube

@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();
}
origin: SonarSource/sonarqube

 @Test
 public void test_example() {
  userSession.logIn().setSystemAdministrator();
  when(workerCountProvider.get()).thenReturn(5);
  WsActionTester ws = new WsActionTester(new WorkerCountAction(userSession, workerCountProvider));

  String response = ws.newRequest().execute().getInput();

  assertJson(response).isSimilarTo(ws.getDef().responseExample());
 }
}
origin: SonarSource/sonarqube

@Test
public void action_cancel_all_is_defined() {
 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("cancel_all");
 WebService.Action action = controller.actions().iterator().next();
 assertThat(action.isPost()).isTrue();
 assertThat(action.description()).isNotEmpty();
 assertThat(action.responseExample()).isNull();
 assertThat(action.params()).isEmpty();
}
origin: SonarSource/sonarqube

@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();
}
origin: SonarSource/sonarqube

private static void writeAction(JsonWriter writer, WebService.Action action, boolean includeInternals) {
 if (includeInternals || !action.isInternal()) {
  writer.beginObject();
  writer.prop("key", action.key());
  writer.prop("description", action.description());
  writer.prop("since", action.since());
  writer.prop("deprecatedSince", action.deprecatedSince());
  writer.prop("internal", action.isInternal());
  writer.prop("post", action.isPost());
  writer.prop("hasResponseExample", action.responseExample() != null);
  writeChangelog(writer, action);
  writeParameters(writer, action, includeInternals);
  writer.endObject();
 }
}
origin: SonarSource/sonarqube

@Test
public void action_status_is_defined() {
 WebService.Action action = underTest.getDef();
 assertThat(action.isPost()).isFalse();
 assertThat(action.description()).isNotEmpty();
 assertThat(action.responseExample()).isNotNull();
 assertThat(action.params()).isEmpty();
}
origin: SonarSource/sonarqube

@Test
public void verify_definition() {
 WebService.Action action = wsTester.getDef();
 assertThat(action.key()).isEqualTo("search");
 assertThat(action.isInternal()).isTrue();
 assertThat(action.isPost()).isFalse();
 assertThat(action.since()).isEqualTo("6.2");
 assertThat(action.description()).isEqualTo("Search for root users.<br/>" +
  "Requires to be root.");
 assertThat(action.responseExample()).isNotNull();
 assertThat(action.deprecatedKey()).isNull();
 assertThat(action.deprecatedSince()).isNull();
 assertThat(action.handler()).isSameAs(underTest);
 assertThat(action.params()).isEmpty();
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action action = tester.getDef();
 assertThat(action.key()).isEqualTo("bulk_change");
 assertThat(action.isPost()).isTrue();
 assertThat(action.isInternal()).isFalse();
 assertThat(action.params()).hasSize(10);
 assertThat(action.responseExample()).isNotNull();
}
org.sonar.api.server.wsWebService$ActionresponseExample

Popular methods of WebService$Action

  • isInternal
  • key
  • param
  • changelog
  • deprecatedSince
  • description
  • handler
  • isPost
  • params
  • path
  • responseExampleAsString
  • since
    Set if different than controller.
  • responseExampleAsString,
  • since,
  • <init>,
  • responseExampleFormat,
  • logWarningIf,
  • deprecatedKey,
  • toString

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now