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

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • runOnUiThread (Activity)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top 17 Free Sublime Text 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