Tabnine Logo
WebService$Controller.path
Code IndexAdd Tabnine to your IDE (free)

How to use
path
method
in
org.sonar.api.server.ws.WebService$Controller

Best Java code snippets using org.sonar.api.server.ws.WebService$Controller.path (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: SonarSource/sonarqube

private Action(Controller controller, NewAction newAction) {
 this.key = newAction.key;
 this.deprecatedKey = newAction.deprecatedKey;
 this.path = format("%s/%s", controller.path(), key);
 this.description = newAction.description;
 this.since = newAction.since;
 this.deprecatedSince = newAction.deprecatedSince;
 this.post = newAction.post;
 this.isInternal = newAction.isInternal;
 this.responseExample = newAction.responseExample;
 this.handler = newAction.handler;
 this.changelog = newAction.changelog;
 checkState(this.handler != null, "RequestHandler is not set on action %s", path);
 logWarningIf(isNullOrEmpty(this.description), "Description is not set on action " + path);
 logWarningIf(isNullOrEmpty(this.since), "Since is not set on action " + path);
 logWarningIf(!this.post && this.responseExample == null, "The response example is not set on action " + path);
 Map<String, Param> paramsBuilder = new HashMap<>();
 for (NewParam newParam : newAction.newParams.values()) {
  paramsBuilder.put(newParam.key, new Param(this, newParam));
 }
 this.params = Collections.unmodifiableMap(paramsBuilder);
}
origin: SonarSource/sonarqube

private void initWebServiceEngine(WsUrl... wsUrls) {
 List<WebService.Controller> controllers = new ArrayList<>();
 for (WsUrl wsUrl : wsUrls) {
  String controller = wsUrl.getController();
  WebService.Controller wsController = mock(WebService.Controller.class);
  when(wsController.path()).thenReturn(controller);
  List<WebService.Action> actions = new ArrayList<>();
  for (String action : wsUrl.getActions()) {
   WebService.Action wsAction = mock(WebService.Action.class);
   when(wsAction.path()).thenReturn(controller + "/" + action);
   when(wsAction.key()).thenReturn(action);
   when(wsAction.handler()).thenReturn(wsUrl.getRequestHandler());
   actions.add(wsAction);
  }
  when(wsController.actions()).thenReturn(actions);
  controllers.add(wsController);
 }
 when(webServiceEngine.controllers()).thenReturn(controllers);
 underTest = new WebServiceFilter(webServiceEngine, runtime);
}
origin: SonarSource/sonarqube

@Test
public void definition() {
 assertThat(underTest.path()).isEqualTo("api/project_tags");
 assertThat(underTest.since()).isEqualTo("6.4");
 assertThat(underTest.description()).isNotEmpty();
}
origin: org.sonarsource.sonarqube/sonar-plugin-api

private Action(Controller controller, NewAction newAction) {
 this.key = newAction.key;
 this.deprecatedKey = newAction.deprecatedKey;
 this.path = format("%s/%s", controller.path(), key);
 this.description = newAction.description;
 this.since = newAction.since;
 this.deprecatedSince = newAction.deprecatedSince;
 this.post = newAction.post;
 this.isInternal = newAction.isInternal;
 this.responseExample = newAction.responseExample;
 this.handler = newAction.handler;
 this.changelog = newAction.changelog;
 checkState(this.handler != null, "RequestHandler is not set on action %s", path);
 logWarningIf(isNullOrEmpty(this.description), "Description is not set on action " + path);
 logWarningIf(isNullOrEmpty(this.since), "Since is not set on action " + path);
 logWarningIf(!this.post && this.responseExample == null, "The response example is not set on action " + path);
 Map<String, Param> paramsBuilder = new HashMap<>();
 for (NewParam newParam : newAction.newParams.values()) {
  paramsBuilder.put(newParam.key, new Param(this, newParam));
 }
 this.params = Collections.unmodifiableMap(paramsBuilder);
}
origin: org.sonarsource.sonarqube/sonar-server

private static void writeController(JsonWriter writer, WebService.Controller controller, boolean includeInternals) {
 if (includeInternals || !controller.isInternal()) {
  writer.beginObject();
  writer.prop("path", controller.path());
  writer.prop("since", controller.since());
  writer.prop("description", controller.description());
  // sort actions by key
  Ordering<WebService.Action> ordering = Ordering.natural().onResultOf(WebService.Action::key);
  writer.name("actions").beginArray();
  for (WebService.Action action : ordering.sortedCopy(controller.actions())) {
   writeAction(writer, action, includeInternals);
  }
  writer.endArray();
  writer.endObject();
 }
}
origin: org.codehaus.sonar/sonar-plugin-api

private Action(Controller controller, NewAction newAction) {
 this.key = newAction.key;
 this.deprecatedKey = newAction.deprecatedKey;
 this.path = String.format("%s/%s", controller.path(), key);
 this.description = newAction.description;
 this.since = StringUtils.defaultIfBlank(newAction.since, controller.since);
 this.post = newAction.post;
 this.isInternal = newAction.isInternal;
 this.responseExample = newAction.responseExample;
 if (newAction.handler == null) {
  throw new IllegalArgumentException("RequestHandler is not set on action " + path);
 }
 this.handler = newAction.handler;
 ImmutableMap.Builder<String, Param> paramsBuilder = ImmutableMap.builder();
 for (NewParam newParam : newAction.newParams.values()) {
  paramsBuilder.put(newParam.key, new Param(this, newParam));
 }
 this.params = paramsBuilder.build();
}
origin: SonarSource/sonarqube

assertThat(controller.path()).isEqualTo("api/metric");
assertThat(controller.description()).isEqualTo("Metrics");
assertThat(controller.since()).isEqualTo("3.2");
origin: SonarSource/sonarqube

@Test
public void define_ws() {
 WsTester tester = new WsTester(underTest);
 WebService.Controller controller = tester.controller("api/webservices");
 assertThat(controller).isNotNull();
 assertThat(controller.path()).isEqualTo("api/webservices");
 assertThat(controller.since()).isEqualTo("4.2");
 assertThat(controller.description()).isNotEmpty();
 assertThat(controller.actions()).hasSize(2);
 WebService.Action index = controller.action("list");
 assertThat(index).isNotNull();
 assertThat(index.key()).isEqualTo("list");
 assertThat(index.handler()).isNotNull();
 assertThat(index.since()).isEqualTo("4.2");
 assertThat(index.isPost()).isFalse();
 assertThat(index.isInternal()).isFalse();
 assertThat(controller.action("response_example")).isNotNull();
}
origin: SonarSource/sonarqube

@Test
public void should_be_well_defined() {
 Controller controller = tester.controller(CONTROLLER_LANGUAGES);
 assertThat(controller).isNotNull();
 assertThat(controller.description()).isNotEmpty();
 assertThat(controller.isInternal()).isFalse();
 assertThat(controller.path()).isEqualTo(CONTROLLER_LANGUAGES);
 assertThat(controller.since()).isEqualTo("5.1");
 assertThat(controller.actions()).hasSize(1);
 Action list = controller.action(ACTION_LIST);
 assertThat(list).isNotNull();
 assertThat(list.description()).isNotEmpty();
 assertThat(list.handler()).isInstanceOf(ListAction.class);
 assertThat(list.isInternal()).isFalse();
 assertThat(list.isPost()).isFalse();
 assertThat(list.responseExampleAsString()).isNotEmpty();
 assertThat(list.params()).hasSize(2);
}
origin: SonarSource/sonarqube

private static void writeController(JsonWriter writer, WebService.Controller controller, boolean includeInternals) {
 if (includeInternals || !controller.isInternal()) {
  writer.beginObject();
  writer.prop("path", controller.path());
  writer.prop("since", controller.since());
  writer.prop("description", controller.description());
  // sort actions by key
  Ordering<WebService.Action> ordering = Ordering.natural().onResultOf(WebService.Action::key);
  writer.name("actions").beginArray();
  for (WebService.Action action : ordering.sortedCopy(controller.actions())) {
   writeAction(writer, action, includeInternals);
  }
  writer.endArray();
  writer.endObject();
 }
}
origin: SonarSource/sonarqube

 @Test
 public void definition() {
  assertThat(underTest.path()).isEqualTo("api/favorites");
 }
}
origin: SonarSource/sonarqube

@Test
public void definition() {
 assertThat(underTest.path()).isEqualTo("api/notifications");
}
origin: SonarSource/sonarqube

@Test
public void define_controller() {
 WebService.Controller controller = controller();
 assertThat(controller).isNotNull();
 assertThat(controller.path()).isEqualTo("api/profiles");
 assertThat(controller.description()).isNotEmpty();
 assertThat(controller.actions()).hasSize(2);
}
org.sonar.api.server.wsWebService$Controllerpath

Popular methods of WebService$Controller

  • actions
  • action
  • description
  • isInternal
    Returns true if all the actions are for internal use
  • since
  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • getContentResolver (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JLabel (javax.swing)
  • 21 Best IntelliJ Plugins
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