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)

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

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • BoxLayout (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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