Tabnine Logo
WebService$Action.responseExampleAsString
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action definition = ws.getDef();
 assertThat(definition.key()).isEqualTo("current");
 assertThat(definition.description()).isEqualTo("Get the details of the current authenticated user.");
 assertThat(definition.since()).isEqualTo("5.2");
 assertThat(definition.isPost()).isFalse();
 assertThat(definition.isInternal()).isTrue();
 assertThat(definition.responseExampleAsString()).isNotEmpty();
 assertThat(definition.params()).isEmpty();
 assertThat(definition.changelog()).hasSize(2);
}
origin: SonarSource/sonarqube

@Test
public void definition() {
 WebService.Action definition = ws.getDef();
 assertThat(definition.key()).isEqualTo("list");
 assertThat(definition.isPost()).isFalse();
 assertThat(definition.since()).isEqualTo("6.3");
 assertThat(definition.responseExampleAsString()).isNotEmpty();
 assertThat(definition.params()).hasSize(1);
 WebService.Param loginParam = definition.param("login");
 assertThat(loginParam.since()).isEqualTo("6.4");
 assertThat(loginParam.isRequired()).isFalse();
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WebService.Action webService = ws.getDef();
 assertThat(webService.key()).isEqualTo("identity_providers");
 assertThat(webService.responseExampleAsString()).isNotEmpty();
 assertThat(webService.since()).isEqualTo("5.5");
 assertThat(webService.isInternal()).isTrue();
}
origin: SonarSource/sonarqube

@Test
public void test_example() {
 when(pluginRepository.getPluginInfos()).thenReturn(asList(
  new PluginInfo("findbugs").setName("Findbugs").setVersion(Version.create("2.1")),
  new PluginInfo("l10nfr").setName("French Pack").setVersion(Version.create("1.10")),
  new PluginInfo("jira").setName("JIRA").setVersion(Version.create("1.2"))));
 String result = ws.newRequest().execute().getInput();
 assertJson(result).isSimilarTo(ws.getDef().responseExampleAsString());
}
origin: SonarSource/sonarqube

@Test
public void test_example() {
 UserDto user = db.users().insertUser(u -> u
  .setLogin("ada.lovelace")
  .setEmail("ada.lovelace@noteg.com")
  .setName("Ada Lovelace")
  .setLocal(true)
  .setScmAccounts(singletonList("al")));
 logInAsSystemAdministrator();
 String json = deactivate(user.getLogin()).getInput();
 assertJson(json).isSimilarTo(ws.getDef().responseExampleAsString());
}
origin: SonarSource/sonarqube

@Test
public void json_example() {
 OrganizationDto organization = db.organizations().insert();
 db.users().insertDefaultGroup(organization, "default");
 UserDto user = db.users().insertUser(u -> u.setLogin("ada.lovelace").setName("Ada Lovelace").setEmail("ada@lovelace.com"));
 String result = ws.newRequest().setParam(PARAM_ORGANIZATION, organization.getKey()).setParam("login", user.getLogin()).execute().getInput();
 assertJson(result).isSimilarTo(ws.getDef().responseExampleAsString());
}
origin: SonarSource/sonarqube

@Test
public void definition() {
 WebService.Action definition = ws.getDef();
 assertThat(definition).isNotNull();
 assertThat(definition.isPost()).isFalse();
 assertThat(definition.isInternal()).isTrue();
 assertThat(definition.params()).hasSize(2).extracting("key").containsOnly(
  "leftKey", "rightKey");
 assertThat(definition.responseExampleAsString()).isNotEmpty();
}
origin: SonarSource/sonarqube

@Test
public void test_definition() {
 WsActionTester ws = new WsActionTester(new WorkerCountAction(userSession, workerCountProvider));
 WebService.Action action = ws.getDef();
 assertThat(action.key()).isEqualTo("worker_count");
 assertThat(action.since()).isEqualTo("6.5");
 assertThat(action.responseExampleAsString()).isNotEmpty();
 assertThat(action.params()).isEmpty();
}
origin: SonarSource/sonarqube

@Test
public void define_exporters_action() {
 WebService.Action exporters = ws.getDef();
 assertThat(exporters).isNotNull();
 assertThat(exporters.isPost()).isFalse();
 assertThat(exporters.params()).isEmpty();
 assertThat(exporters.responseExampleAsString()).isNotEmpty();
}
origin: SonarSource/sonarqube

@Test
public void json_example() {
 String result = ws.newRequest().execute().getInput();
 assertJson(result).isSimilarTo(ws.getDef().responseExampleAsString());
}
origin: SonarSource/sonarqube

@Test
public void define_index_action() {
 WebService.Action action = ws.getDef();
 assertThat(action).isNotNull();
 assertThat(action.responseExampleAsString()).isNotEmpty();
 assertThat(action.params()).hasSize(8);
}
origin: SonarSource/sonarqube

@Test
public void test_example_of_response() {
 userSession.logIn().setSystemAdministrator();
 when(ceQueue.getWorkersPauseStatus()).thenReturn(CeQueue.WorkersPauseStatus.PAUSING);
 ws.newRequest().execute().assertJson(ws.getDef().responseExampleAsString());
}
origin: SonarSource/sonarqube

@Test
public void test_response_example() {
 logInAsRoot();
 UserDto user = UserTesting.newUserDto().setLogin("daniel").setName("Daniel").setEmail("daniel@corp.com");
 UserDto rootDto = userDao.insert(dbSession, user);
 userDao.setRoot(dbSession, rootDto.getLogin(), true);
 dbSession.commit();
 TestResponse response = wsTester.newRequest().setMediaType(MediaTypes.JSON).execute();
 assertJson(response.getInput()).isSimilarTo(wsTester.getDef().responseExampleAsString());
}
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 definition() {
 WebService.Action definition = ws.getDef();
 assertThat(definition.key()).isEqualTo("encrypt");
 assertThat(definition.isPost()).isFalse();
 assertThat(definition.isInternal()).isTrue();
 assertThat(definition.responseExampleAsString()).isNotEmpty();
 assertThat(definition.params()).hasSize(1);
}
origin: SonarSource/sonarqube

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

@Test
public void test_definition() {
 WebService.Action def = ws.getDef();
 assertThat(def.key()).isEqualTo("pause");
 assertThat(def.isInternal()).isTrue();
 assertThat(def.isPost()).isTrue();
 assertThat(def.params()).isEmpty();
 assertThat(def.responseExampleAsString()).isNull();
}
origin: SonarSource/sonarqube

@Test
public void importers_nominal() {
 String result = ws.newRequest().execute().getInput();
 assertJson(result).isSimilarTo(ws.getDef().responseExampleAsString());
}
origin: SonarSource/sonarqube

@Test
public void json_example() {
 ComponentDto project = db.components().insertPrivateProject();
 permissionIndexer.allowOnlyAnyone(project);
 RuleDefinitionDto rule = db.rules().insert();
 db.issues().insert(rule, project, project, issue -> issue.setAuthorLogin("luke.skywalker"));
 db.issues().insert(rule, project, project, issue -> issue.setAuthorLogin("leia.organa"));
 issueIndexer.indexOnStartup(emptySet());
 userSession.logIn().addMembership(db.getDefaultOrganization());
 String result = ws.newRequest().execute().getInput();
 assertJson(result).isSimilarTo(ws.getDef().responseExampleAsString());
}
origin: SonarSource/sonarqube

@Test
public void ws_parameters() {
 WebService.Action definition = ws.getDef();
 assertThat(definition.isPost()).isTrue();
 assertThat(definition.key()).isEqualTo("create_event");
 assertThat(definition.responseExampleAsString()).isNotEmpty();
}
org.sonar.api.server.wsWebService$ActionresponseExampleAsString

Popular methods of WebService$Action

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

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Top Sublime Text plugins
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