Class BaseTest

java.lang.Object
org.nuxeo.ecm.restapi.test.BaseTest

@Deprecated(since="2023.13", forRemoval=true) public class BaseTest extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
since 2023.13, use HttpClientTestRule instead
Since:
5.7.2
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static enum 
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.sun.jersey.api.client.Client
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected com.fasterxml.jackson.databind.ObjectMapper
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected com.sun.jersey.api.client.WebResource
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    assertNodeEqualsDoc(com.fasterxml.jackson.databind.JsonNode node, DocumentModel note)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Fetch session invalidations.
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Can be overridden in subclasses to configure the Apache HTTP client, typically by setting a custom connection timeout with:
    protected List<com.fasterxml.jackson.databind.JsonNode>
    getEntries(com.fasterxml.jackson.databind.JsonNode node)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    getErrorMessage(com.fasterxml.jackson.databind.JsonNode node)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getResponse(BaseTest.RequestType requestType, String path, com.sun.jersey.multipart.MultiPart mp)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getResponse(BaseTest.RequestType requestType, String path, com.sun.jersey.multipart.MultiPart mp, Map<String,String> headers)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getResponse(BaseTest.RequestType requestType, String path, String data)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getResponse(BaseTest.RequestType requestType, String path, String data, Map<String,String> headers)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getResponse(BaseTest.RequestType requestType, String path, String data, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, com.sun.jersey.multipart.MultiPart mp, Map<String,String> headers, String... acceptedTypes)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getResponse(BaseTest.RequestType requestType, String path, Map<String,String> headers)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    getResponse(BaseTest.RequestType requestType, String path, javax.ws.rs.core.MultivaluedMap<String,String> queryParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected com.fasterxml.jackson.databind.JsonNode
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected com.fasterxml.jackson.databind.JsonNode
    getResponseAsJson(BaseTest.RequestType responseType, String url, javax.ws.rs.core.MultivaluedMap<String,String> queryParams)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected String
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected com.sun.jersey.api.client.WebResource
    getServiceFor(String username, String password)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a WebResource to perform REST API calls with the given credentials.
    protected com.sun.jersey.api.client.WebResource
    getServiceFor(String resource, String username, String password)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a WebResource to perform calls on the given resource with the given credentials.
    protected boolean
    hasErrorMessage(com.fasterxml.jackson.databind.JsonNode node)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected javax.ws.rs.core.MultivaluedMap<String,String>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Builds and returns a MultivaluedMap filled with the given simple values.
    protected javax.ws.rs.core.MultivaluedMap<String,String>
    multiOf(String k1, String v1, String k2, String v2)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Builds and returns a MultivaluedMap filled with the given simple values.
    protected javax.ws.rs.core.MultivaluedMap<String,String>
    Deprecated, for removal: This API element is subject to removal in a future version.
    Builds and returns a MultivaluedMap filled with the given simple values.
    protected void
    setJSONContentTypeIfAbsent(com.sun.jersey.api.client.WebResource.Builder builder, Map<String,String> headers)
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

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

    • servletContainerFeature

      @Inject protected ServletContainerFeature servletContainerFeature
      Deprecated, for removal: This API element is subject to removal in a future version.
    • mapper

      protected com.fasterxml.jackson.databind.ObjectMapper mapper
      Deprecated, for removal: This API element is subject to removal in a future version.
    • client

      protected com.sun.jersey.api.client.Client client
      Deprecated, for removal: This API element is subject to removal in a future version.
    • service

      protected com.sun.jersey.api.client.WebResource service
      Deprecated, for removal: This API element is subject to removal in a future version.
    • session

      @Inject public CoreSession session
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Constructor Details

    • BaseTest

      public BaseTest()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • doBefore

      public void doBefore()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • doAfter

      public void doAfter()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getBaseURL

      protected String getBaseURL()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getRestApiUrl

      protected String getRestApiUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getServiceFor

      protected com.sun.jersey.api.client.WebResource getServiceFor(String username, String password)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a WebResource to perform REST API calls with the given credentials.

      Since 9.3, uses the Apache HTTP client, more reliable and much more configurable than the one from the JDK.

      Since:
      5.7.3
    • getServiceFor

      protected com.sun.jersey.api.client.WebResource getServiceFor(String resource, String username, String password)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a WebResource to perform calls on the given resource with the given credentials.

      Uses the Apache HTTP client, more reliable and much more configurable than the one from the JDK.

      Since:
      9.3
    • getClientBuilder

      protected JerseyClientHelper.ApacheHttpClientBuilder getClientBuilder()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Can be overridden in subclasses to configure the Apache HTTP client, typically by setting a custom connection timeout with:
      
       @Override
       protected ApacheHttpClientBuilder getClientBuilder() {
           return super.getClientBuilder().setConnectionRequestTimeout(100000)
                                          .setConnectTimeout(100000)
                                          .setSocketTimeout(100000);
       }
       
      Since:
      2023.7
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, Map<String,String> headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, com.sun.jersey.multipart.MultiPart mp)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, com.sun.jersey.multipart.MultiPart mp, Map<String,String> headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, javax.ws.rs.core.MultivaluedMap<String,String> queryParams)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, String data)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, String data, Map<String,String> headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getResponse

      protected CloseableClientResponse getResponse(BaseTest.RequestType requestType, String path, String data, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, com.sun.jersey.multipart.MultiPart mp, Map<String,String> headers, String... acceptedTypes)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setJSONContentTypeIfAbsent

      protected void setJSONContentTypeIfAbsent(com.sun.jersey.api.client.WebResource.Builder builder, Map<String,String> headers)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since:
      9.3
    • getResponseAsJson

      protected com.fasterxml.jackson.databind.JsonNode getResponseAsJson(BaseTest.RequestType responseType, String url) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
      com.fasterxml.jackson.core.JsonProcessingException
    • getResponseAsJson

      protected com.fasterxml.jackson.databind.JsonNode getResponseAsJson(BaseTest.RequestType responseType, String url, javax.ws.rs.core.MultivaluedMap<String,String> queryParams) throws com.fasterxml.jackson.core.JsonProcessingException, IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
      IOException
      Since:
      5.8
    • fetchInvalidations

      protected void fetchInvalidations()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Fetch session invalidations.
      Since:
      5.9.3
    • assertNodeEqualsDoc

      protected void assertNodeEqualsDoc(com.fasterxml.jackson.databind.JsonNode node, DocumentModel note)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getEntries

      protected List<com.fasterxml.jackson.databind.JsonNode> getEntries(com.fasterxml.jackson.databind.JsonNode node)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getErrorMessage

      protected String getErrorMessage(com.fasterxml.jackson.databind.JsonNode node)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since:
      7.1
    • assertEntityEqualsDoc

      protected void assertEntityEqualsDoc(InputStream in, DocumentModel doc) throws IOException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Throws:
      IOException
    • hasErrorMessage

      protected boolean hasErrorMessage(com.fasterxml.jackson.databind.JsonNode node)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since:
      11.1
    • multiOf

      protected javax.ws.rs.core.MultivaluedMap<String,String> multiOf(String k1, String v1)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds and returns a MultivaluedMap filled with the given simple values.
      Since:
      11.1
    • multiOf

      protected javax.ws.rs.core.MultivaluedMap<String,String> multiOf(String k1, String v1, String k2, String v2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds and returns a MultivaluedMap filled with the given simple values.
      Since:
      11.1
    • multiOf

      protected javax.ws.rs.core.MultivaluedMap<String,String> multiOf(Map<String,String> map)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Builds and returns a MultivaluedMap filled with the given simple values.
      Since:
      11.1