Class GadgetSpecClient

java.lang.Object
com.atlassian.jira.testkit.client.RestApiClient<GadgetSpecClient>
com.atlassian.jira.webtests.GadgetSpecClient

public class GadgetSpecClient extends com.atlassian.jira.testkit.client.RestApiClient<GadgetSpecClient>
Simple HTTP client to retrieve a specific gadget spec xml and list of all gadgets in the system.

Note that RestApiClient uses its own user session and does not share user sessions from other parts of the test frameworks, such as Navigation.

By default all HTTP requests will be made using the "admin" credentials. If a different or anonymous credential is required, RestApiClient.loginAs(String) can be used to facilitate such requirement.

  • Nested Class Summary

    Nested classes/interfaces inherited from class com.atlassian.jira.testkit.client.RestApiClient

    com.atlassian.jira.testkit.client.RestApiClient.BackdoorLoggingFilter, com.atlassian.jira.testkit.client.RestApiClient.JsonMediaTypeFilter, com.atlassian.jira.testkit.client.RestApiClient.RestCall
  • Field Summary

    Fields inherited from class com.atlassian.jira.testkit.client.RestApiClient

    REST_VERSION
  • Constructor Summary

    Constructors
    Constructor
    Description
    GadgetSpecClient(com.atlassian.jira.testkit.client.JIRAEnvironmentData environmentData)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Make a HTTP request for all addable gadgets in the system.
    Make a HTTP request to retrieve the content of gadget feed resource.
    com.atlassian.jira.testkit.client.restclient.ParsedResponse<String>
    getGadgetSpecXML(String publishLocation)
    Make a HTTP request for gadget spec XML at the specified publishLocation

    Methods inherited from class com.atlassian.jira.testkit.client.RestApiClient

    anonymous, authenticate, authoriseWithOAuth2, authoriseWithOAuth2, cleanUp, client, createResource, createResource, createResourceGadget, createResourceInternal, errorResponse, expanded, getCredentialsProvider, getEnvironmentData, loginAs, loginAs, registerResponse, resourceRoot, resourceRoot, setOf, toResponse, toResponse, toResponse, withCredentialsProvider

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GadgetSpecClient

      public GadgetSpecClient(com.atlassian.jira.testkit.client.JIRAEnvironmentData environmentData)
  • Method Details

    • getAddableGadgets

      public List<String> getAddableGadgets()
      Make a HTTP request for all addable gadgets in the system.

      Addable gadgets refer to all gadgets that can be added/viewed by currently logged on user.

      Returns:
      List of gadget spec url.
    • getFeedResourceContent

      public String getFeedResourceContent()
      Make a HTTP request to retrieve the content of gadget feed resource.
      Returns:
      String content of the feed resource.
    • getGadgetSpecXML

      public com.atlassian.jira.testkit.client.restclient.ParsedResponse<String> getGadgetSpecXML(String publishLocation)
      Make a HTTP request for gadget spec XML at the specified publishLocation
      Parameters:
      publishLocation - The URL to retrieve the gadget spec.
      Returns:
      Response result of the HTTP request.