Package org.alfresco.rest.core
Class RMRestWrapper
java.lang.Object
org.alfresco.rest.core.RMRestWrapper
Extends
RestWrapper in order to call GS APIs with our own properties- Since:
- 2.6
- Author:
- Tuna Aksoy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the last error thrown (if any).voidassertStatusCodeIs(org.springframework.http.HttpStatus statusCode) Assert that a specific status code is returned.voidauthenticateUser(org.alfresco.utility.model.UserModel userModel) Authenticate specific user to Alfresco REST APIio.restassured.builder.RequestSpecBuilderYou can handle the request sent to server by calling this method.org.alfresco.utility.model.StatusModelGet the most recently returned status object.Get the core class that wraps the ReST APIs.Get the most recently returned status code.org.alfresco.utility.model.UserModelCreate aUserModelfor a new test user.voidprocessEmptyModel(RestRequest simpleRequest) Process a response that has no body - basically will need only the status code from it.processHtmlResponse(RestRequest simpleRequest) Process a response that returns a html<T> TprocessModel(Class<T> classz, RestRequest restRequest) Process responses for a single model asRestSiteModel.<T> TprocessModels(Class<T> classz, RestRequest simpleRequest) Process responses for a collection of models asRestSiteModelsCollection.voidsetStatusCode(String statusCode) Set the status code.Get the Alfresco Core API.Get the Alfresco Search API.
-
Constructor Details
-
RMRestWrapper
public RMRestWrapper()
-
-
Method Details
-
withGSCoreAPI
-
getRestWrapper
Get the core class that wraps the ReST APIs. -
authenticateUser
public void authenticateUser(org.alfresco.utility.model.UserModel userModel) Authenticate specific user to Alfresco REST API -
assertLastError
Get the last error thrown (if any). -
processModels
Process responses for a collection of models asRestSiteModelsCollection. -
processModel
Process responses for a single model asRestSiteModel. -
processEmptyModel
Process a response that has no body - basically will need only the status code from it. -
getLastStatus
public org.alfresco.utility.model.StatusModel getLastStatus()Get the most recently returned status object. -
getStatusCode
Get the most recently returned status code. -
setStatusCode
Set the status code. This should only be needed when calling APIs without using the TAS framework. -
assertStatusCodeIs
public void assertStatusCodeIs(org.springframework.http.HttpStatus statusCode) Assert that a specific status code is returned. -
getParameters
- Returns:
- A parameters string that you could pass on the request ?param=value
-
getTestUser
public org.alfresco.utility.model.UserModel getTestUser()Create aUserModelfor a new test user. -
withCoreAPI
Get the Alfresco Core API. -
withSearchAPI
Get the Alfresco Search API. -
configureRequestSpec
public io.restassured.builder.RequestSpecBuilder configureRequestSpec()You can handle the request sent to server by calling this method. If for example you want to sent multipart form data you can use:restClient.configureRequestSpec() .addMultiPart("filedata", Utility.getResourceTestDataFile("restapi-resource")) .addFormParam("renditions", "doclib") .addFormParam("autoRename", true); restClient.withCoreAPI().usingNode(ContentModel.my()).createNode();This will create the node using the multipart data defined. -
processHtmlResponse
Process a response that returns a html- Throws:
EmptyJsonResponseException- If there is no response from the server.
-