Tabnine Logo
WebService$Action.responseExample
Code IndexAdd Tabnine 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)

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 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

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_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

@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 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_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_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 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 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();
}
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 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 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_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_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 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");
}
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

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now