Class RestHelper


  • @Deprecated
    public class RestHelper
    extends Object
    Deprecated.
    since 6.4 Use com.atlassian.confluence.test.stateless.ConfluenceStatelessRestTestRunner instead
    Provides methods for creating REST WebResource objects and processing REST calls.
    • Constructor Summary

      Constructors 
      Constructor Description
      RestHelper()
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void doDeleteJson​(String url, User user)
      Deprecated.
       
      static <T> T doGet​(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass)
      Deprecated.
       
      static <T> T doGet​(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass, String requestType)
      Deprecated.
       
      static @NonNull com.sun.jersey.api.client.ClientResponse doGetRequest​(com.sun.jersey.api.client.WebResource resource, String requestType)
      Deprecated.
       
      static URI doPost​(com.sun.jersey.api.client.WebResource resource, Object entity)
      Deprecated.
       
      static <T> T doPut​(com.sun.jersey.api.client.WebResource resource, T entity)
      Deprecated.
       
      static <T> T doPut​(com.sun.jersey.api.client.WebResource resource, T entity, String requestType)
      Deprecated.
       
      static <T> T doRawGet​(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass)
      Deprecated.
      Do a get without asserting success
      static <T> T doRawGet​(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass, String requestType)
      Deprecated.
      Do a get without asserting success, specifying the request type.
      static com.sun.jersey.api.client.WebResource expand​(com.sun.jersey.api.client.WebResource webResource, String... values)
      Deprecated.
       
      static com.sun.jersey.api.client.WebResource expandWithIndexes​(com.sun.jersey.api.client.WebResource webResource, String value, int start, int end)
      Deprecated.
       
      static org.codehaus.jackson.JsonNode fetchJsonResponse​(com.sun.jersey.api.client.WebResource resource)
      Deprecated.
      Send a GET request to the provided WebResource and return the response as a JSON object.
      static com.sun.jersey.api.client.Client getClient()
      Deprecated.
      Return a jersey client configured for Jackson annotations.
      static com.sun.jersey.api.client.Client getClient​(@Nullable org.codehaus.jackson.map.Module jacksonModule)
      Deprecated.
      Returns a Client configured with the provided jackson module for custom deserialization.
      static String getJsonResponseString​(com.sun.jersey.api.client.WebResource resource)
      Deprecated.
      Send a GET request to the provided WebResource and return the response as a JSON string.
      static String getPrototypeRestBaseUrl​(BaseUrlSelector baseUrlSelector)
      Deprecated.
       
      static String getPrototypeRestBaseUrl​(com.atlassian.confluence.test.BaseUrlSelector baseUrlSelector)
      Deprecated.
       
      static String getPrototypeRestBaseUrl​(String baseUrl)
      Deprecated.
       
      static com.sun.jersey.api.client.Client newClient()
      Deprecated.
      Create a new Jersey client configured for Jackson annotations.
      static com.sun.jersey.api.client.Client newClient​(@Nullable org.codehaus.jackson.map.Module jacksonModule)
      Deprecated.
      Creates a new client configured with the provided jackson module for custom deserialization
      static com.sun.jersey.api.client.WebResource.Builder newJsonResource​(String url, User user)
      Deprecated.
      Returns a new web resource accepting JSON, with OS credentials for the passed user.
      static @NonNull com.sun.jersey.api.client.WebResource newResource​(@Nullable String url, @Nullable User user)
      Deprecated.
      Returns a new web resource with OS credentials for the passed user.
      static com.sun.jersey.api.client.WebResource newResource​(User user)
      Deprecated.
      static org.codehaus.jackson.JsonNode postJson​(String url, String jsonPayload, User user)
      Deprecated.
       
      static void postJsonWithNoResponse​(String url, String jsonPayload, User user)
      Deprecated.
       
    • Field Detail

      • BASE_URL

        @Deprecated
        public static final String BASE_URL
        Deprecated.
        since 5.6 Use BaseUrlSelector.getBaseUrl()
    • Constructor Detail

      • RestHelper

        public RestHelper()
        Deprecated.
    • Method Detail

      • newClient

        public static com.sun.jersey.api.client.Client newClient()
        Deprecated.
        Create a new Jersey client configured for Jackson annotations.
      • newClient

        public static com.sun.jersey.api.client.Client newClient​(@Nullable org.codehaus.jackson.map.Module jacksonModule)
        Deprecated.
        Creates a new client configured with the provided jackson module for custom deserialization
      • getClient

        public static com.sun.jersey.api.client.Client getClient​(@Nullable org.codehaus.jackson.map.Module jacksonModule)
        Deprecated.
        Returns a Client configured with the provided jackson module for custom deserialization. May return a client previously used, or currently in use, by another test.
      • getClient

        public static com.sun.jersey.api.client.Client getClient()
        Deprecated.
        Return a jersey client configured for Jackson annotations. May return a client previously used, or currently in use, by another test.
      • newResource

        public static @NonNull com.sun.jersey.api.client.WebResource newResource​(@Nullable String url,
                                                                                 @Nullable User user)
        Deprecated.
        Returns a new web resource with OS credentials for the passed user.
      • newJsonResource

        public static com.sun.jersey.api.client.WebResource.Builder newJsonResource​(String url,
                                                                                    User user)
        Deprecated.
        Returns a new web resource accepting JSON, with OS credentials for the passed user.
      • fetchJsonResponse

        public static org.codehaus.jackson.JsonNode fetchJsonResponse​(com.sun.jersey.api.client.WebResource resource)
        Deprecated.
        Send a GET request to the provided WebResource and return the response as a JSON object.
      • getJsonResponseString

        public static String getJsonResponseString​(com.sun.jersey.api.client.WebResource resource)
        Deprecated.
        Send a GET request to the provided WebResource and return the response as a JSON string.
      • postJsonWithNoResponse

        public static void postJsonWithNoResponse​(String url,
                                                  String jsonPayload,
                                                  User user)
        Deprecated.
      • doDeleteJson

        public static void doDeleteJson​(String url,
                                        User user)
        Deprecated.
      • doGet

        public static <T> T doGet​(com.sun.jersey.api.client.WebResource resource,
                                  Class<T> entityClass)
        Deprecated.
      • doGet

        public static <T> T doGet​(com.sun.jersey.api.client.WebResource resource,
                                  Class<T> entityClass,
                                  String requestType)
        Deprecated.
      • getPrototypeRestBaseUrl

        public static String getPrototypeRestBaseUrl​(BaseUrlSelector baseUrlSelector)
        Deprecated.
      • getPrototypeRestBaseUrl

        public static String getPrototypeRestBaseUrl​(com.atlassian.confluence.test.BaseUrlSelector baseUrlSelector)
        Deprecated.
      • getPrototypeRestBaseUrl

        public static String getPrototypeRestBaseUrl​(String baseUrl)
        Deprecated.
      • doRawGet

        public static <T> T doRawGet​(com.sun.jersey.api.client.WebResource resource,
                                     Class<T> entityClass)
        Deprecated.
        Do a get without asserting success
      • doRawGet

        public static <T> T doRawGet​(com.sun.jersey.api.client.WebResource resource,
                                     Class<T> entityClass,
                                     String requestType)
        Deprecated.
        Do a get without asserting success, specifying the request type.
      • doGetRequest

        public static @NonNull com.sun.jersey.api.client.ClientResponse doGetRequest​(com.sun.jersey.api.client.WebResource resource,
                                                                                     String requestType)
        Deprecated.
      • doPut

        public static <T> T doPut​(com.sun.jersey.api.client.WebResource resource,
                                  T entity)
        Deprecated.
      • doPut

        public static <T> T doPut​(com.sun.jersey.api.client.WebResource resource,
                                  T entity,
                                  String requestType)
        Deprecated.
      • doPost

        public static URI doPost​(com.sun.jersey.api.client.WebResource resource,
                                 Object entity)
        Deprecated.
      • expand

        public static com.sun.jersey.api.client.WebResource expand​(com.sun.jersey.api.client.WebResource webResource,
                                                                   String... values)
        Deprecated.
      • expandWithIndexes

        public static com.sun.jersey.api.client.WebResource expandWithIndexes​(com.sun.jersey.api.client.WebResource webResource,
                                                                              String value,
                                                                              int start,
                                                                              int end)
        Deprecated.