mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-5645: Automate AC Prevent Classification Beyond Parents Classification: added checks for response code and message
This commit is contained in:
@@ -39,8 +39,6 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_CONTAINER_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.user.UserPermissions.PERMISSION_FILING;
|
||||
import static org.alfresco.rest.rm.community.model.user.UserRoles.ROLE_RM_USER;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryChildModel;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createRecordCategoryModel;
|
||||
import static org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil.createTempFile;
|
||||
@@ -80,6 +78,7 @@ import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.FolderModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
@@ -615,4 +614,26 @@ public class BaseRMRestTest extends RestTest
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to check the response code and message returned
|
||||
*
|
||||
* @param setClassificationResponse
|
||||
* @param nodeId
|
||||
*/
|
||||
public List<String> getResponseCodeAndMessage(JSONObject setClassificationResponse, String nodeId)
|
||||
{
|
||||
List<String> response = new ArrayList<String>();
|
||||
if (setClassificationResponse != null)
|
||||
{
|
||||
String message = setClassificationResponse.getString("message");
|
||||
response.add(message);
|
||||
if (setClassificationResponse.getJSONObject("status") != null)
|
||||
{
|
||||
String code = setClassificationResponse.getJSONObject("status").get("code").toString();
|
||||
response.add(code);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user