RM-5416: REST API Tests for Folder Classification - removing the base class

This commit is contained in:
jcule
2017-09-22 10:04:30 +01:00
parent c0bd488a3f
commit 51135a83c0
3 changed files with 75 additions and 55 deletions

View File

@@ -24,6 +24,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.core;
import com.jayway.restassured.builder.RequestSpecBuilder;
@@ -34,6 +35,7 @@ import org.alfresco.rest.model.RestHtmlResponse;
import org.alfresco.rest.model.RestSiteModel;
import org.alfresco.rest.model.RestSiteModelsCollection;
import org.alfresco.rest.requests.coreAPI.RestCoreAPI;
import org.alfresco.rest.requests.search.SearchAPI;
import org.alfresco.rest.rm.community.requests.gscore.GSCoreAPI;
import org.alfresco.utility.model.StatusModel;
import org.alfresco.utility.model.UserModel;
@@ -145,16 +147,24 @@ public class RMRestWrapper
return restWrapper.withCoreAPI();
}
/** Get the Alfresco Search API. */
public SearchAPI withSearchAPI()
{
return restWrapper.withSearchAPI();
}
/**
* 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: <pre>
* restClient.configureRequestSpec()
* .addMultiPart("filedata", Utility.getResourceTestDataFile("restapi-resource"))
* .addFormParam("renditions", "doclib")
* .addFormParam("autoRename", true);
* 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:
*
* <pre>
* restClient.configureRequestSpec().addMultiPart("filedata", Utility.getResourceTestDataFile("restapi-resource"))
* .addFormParam("renditions", "doclib").addFormParam("autoRename", true);
*
* restClient.withCoreAPI().usingNode(ContentModel.my()).createNode();
* </pre> This will create the node using the multipart data defined.
* </pre>
*
* This will create the node using the multipart data defined.
*/
public RequestSpecBuilder configureRequestSpec()
{

View File

@@ -24,6 +24,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
package org.alfresco.rest.core;
import static lombok.AccessLevel.PROTECTED;
@@ -32,6 +33,7 @@ import javax.annotation.Resource;
import org.alfresco.rest.requests.Node;
import org.alfresco.rest.requests.coreAPI.RestCoreAPI;
import org.alfresco.rest.requests.search.SearchAPI;
import org.alfresco.rest.rm.community.requests.gscore.GSCoreAPI;
import org.alfresco.rest.rm.community.requests.gscore.api.FilePlanAPI;
import org.alfresco.rest.rm.community.requests.gscore.api.FilesAPI;
@@ -65,7 +67,7 @@ import lombok.Setter;
public class RestAPIFactory
{
@Autowired
@Getter (value = PROTECTED)
@Getter(value = PROTECTED)
private DataUser dataUser;
@Resource(name = "RMRestWrapper")
@@ -85,6 +87,12 @@ public class RestAPIFactory
return getRmRestWrapper().withCoreAPI();
}
private SearchAPI getSearchAPI(UserModel userModel)
{
getRmRestWrapper().authenticateUser(userModel != null ? userModel : getDataUser().getAdminUser());
return getRmRestWrapper().withSearchAPI();
}
public Node getNodeAPI(RepoTestModel model) throws Exception
{
return getCoreAPI(null).usingNode(model);