mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4405: CI remediation.
This commit is contained in:
@@ -129,8 +129,14 @@ public class FilePlanComponentAPI extends RestAPI<FilePlanComponentAPI>
|
|||||||
public FilePlanComponent createFilePlanComponent(FilePlanComponent filePlanComponentModel, String parentId) throws Exception
|
public FilePlanComponent createFilePlanComponent(FilePlanComponent filePlanComponentModel, String parentId) throws Exception
|
||||||
{
|
{
|
||||||
mandatoryObject("filePlanComponentProperties", filePlanComponentModel);
|
mandatoryObject("filePlanComponentProperties", filePlanComponentModel);
|
||||||
|
mandatoryString("parentId", parentId);
|
||||||
|
|
||||||
return doCreateFilePlanComponent(toJson(filePlanComponentModel), parentId);
|
return usingRestWrapper().processModel(FilePlanComponent.class, requestWithBody(
|
||||||
|
POST,
|
||||||
|
toJson(filePlanComponentModel),
|
||||||
|
"fileplan-components/{fileplanComponentId}/children?{parameters}",
|
||||||
|
parentId,
|
||||||
|
getParameters()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -182,24 +188,6 @@ public class FilePlanComponentAPI extends RestAPI<FilePlanComponentAPI>
|
|||||||
return response.jsonPath().getObject("entry", FilePlanComponent.class);
|
return response.jsonPath().getObject("entry", FilePlanComponent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper method for handling low-level fileplan component creation requests
|
|
||||||
* @param requestBody
|
|
||||||
* @param parentId
|
|
||||||
* @return Newly created {@link FilePlanComponent}
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private FilePlanComponent doCreateFilePlanComponent(String requestBody, String parentId) throws Exception
|
|
||||||
{
|
|
||||||
mandatoryString("parentId", parentId);
|
|
||||||
return usingRestWrapper().processModel(FilePlanComponent.class, requestWithBody(
|
|
||||||
POST,
|
|
||||||
requestBody,
|
|
||||||
"fileplan-components/{fileplanComponentId}/children?{parameters}",
|
|
||||||
parentId,
|
|
||||||
getParameters()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates a file plan component
|
* Updates a file plan component
|
||||||
*
|
*
|
||||||
|
@@ -30,6 +30,8 @@ import static java.lang.Integer.parseInt;
|
|||||||
|
|
||||||
import static org.alfresco.rest.rm.community.base.TestData.CATEGORY_TITLE;
|
import static org.alfresco.rest.rm.community.base.TestData.CATEGORY_TITLE;
|
||||||
import static org.alfresco.rest.rm.community.base.TestData.FOLDER_TITLE;
|
import static org.alfresco.rest.rm.community.base.TestData.FOLDER_TITLE;
|
||||||
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
||||||
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.UNFILED_RECORD_FOLDER_TYPE;
|
||||||
@@ -55,6 +57,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.PropertySource;
|
import org.springframework.context.annotation.PropertySource;
|
||||||
import org.testng.annotations.BeforeClass;
|
import org.testng.annotations.BeforeClass;
|
||||||
|
import org.testng.annotations.DataProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for all IG REST API Tests
|
* Base class for all IG REST API Tests
|
||||||
@@ -98,6 +101,19 @@ public class BaseRestTest extends RestTest
|
|||||||
public static final String RM_TITLE = "Records Management";
|
public static final String RM_TITLE = "Records Management";
|
||||||
public static final String RM_DESCRIPTION = "Records Management Site";
|
public static final String RM_DESCRIPTION = "Records Management Site";
|
||||||
|
|
||||||
|
/** Valid root containers where electronic and non-electronic records can be created */
|
||||||
|
@DataProvider(name = "validContainers")
|
||||||
|
public Object[][] rootContainers() throws Exception {
|
||||||
|
return new Object[][] {
|
||||||
|
// an arbitrary record folder
|
||||||
|
{ createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString()) },
|
||||||
|
// unfiled records root
|
||||||
|
{ getFilePlanComponentAsUser(dataUser.getAdminUser(), UNFILED_RECORDS_CONTAINER_ALIAS.toString()) },
|
||||||
|
// an arbitrary unfiled records folder
|
||||||
|
{ createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()) }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.rest.RestTest#checkServerHealth()
|
* @see org.alfresco.rest.RestTest#checkServerHealth()
|
||||||
*/
|
*/
|
||||||
|
@@ -141,5 +141,4 @@ public interface TestData
|
|||||||
{ CONTENT_TYPE.toString()}
|
{ CONTENT_TYPE.toString()}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -50,9 +50,13 @@ import org.testng.annotations.DataProvider;
|
|||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Create/File electronic records tests
|
||||||
|
* <br>
|
||||||
|
* These tests only test the creation and filing of electronic records, update at
|
||||||
|
* present isn't implemented in the API under test.
|
||||||
|
* <p>
|
||||||
* @author Kristijan Conkas
|
* @author Kristijan Conkas
|
||||||
* @since
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
public class ElectronicRecordTests extends BaseRestTest
|
public class ElectronicRecordTests extends BaseRestTest
|
||||||
{
|
{
|
||||||
@@ -81,19 +85,6 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Valid root containers where electronic records can be created */
|
|
||||||
@DataProvider(name = "validContainers")
|
|
||||||
public Object[][] rootContainers() throws Exception {
|
|
||||||
return new Object[][] {
|
|
||||||
// an arbitrary record folder
|
|
||||||
{ createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString()) },
|
|
||||||
// unfiled records root
|
|
||||||
{ getFilePlanComponentAsUser(dataUser.getAdminUser(), UNFILED_RECORDS_CONTAINER_ALIAS.toString()) },
|
|
||||||
// an arbitrary unfiled records folder
|
|
||||||
{ createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()) }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is NOT a record folder or an unfiled record folder
|
* Given a parent container that is NOT a record folder or an unfiled record folder
|
||||||
|
@@ -31,7 +31,6 @@ import static java.util.Arrays.asList;
|
|||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.HOLDS_ALIAS;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.HOLDS_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.TRANSFERS_ALIAS;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.TRANSFERS_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
|
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.NON_ELECTRONIC_RECORD_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.NON_ELECTRONIC_RECORD_TYPE;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_CATEGORY_TYPE;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE;
|
||||||
@@ -56,7 +55,6 @@ import org.alfresco.utility.data.DataUser;
|
|||||||
import org.alfresco.utility.model.SiteModel;
|
import org.alfresco.utility.model.SiteModel;
|
||||||
import org.alfresco.utility.model.UserModel;
|
import org.alfresco.utility.model.UserModel;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.testng.annotations.DataProvider;
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -76,19 +74,6 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RMSiteAPI rmSiteAPI;
|
private RMSiteAPI rmSiteAPI;
|
||||||
|
|
||||||
/** Valid root containers where non-electronic records can be created */
|
|
||||||
@DataProvider(name = "validContainers")
|
|
||||||
public Object[][] rootContainers() throws Exception {
|
|
||||||
return new Object[][] {
|
|
||||||
// an arbitrary record folder
|
|
||||||
{ createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString()) },
|
|
||||||
// unfiled records root
|
|
||||||
{ getFilePlanComponentAsUser(dataUser.getAdminUser(), UNFILED_RECORDS_CONTAINER_ALIAS.toString()) },
|
|
||||||
// an arbitrary unfiled records folder
|
|
||||||
{ createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()) }
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is NOT a record folder or an unfiled record folder
|
* Given a parent container that is NOT a record folder or an unfiled record folder
|
||||||
|
Reference in New Issue
Block a user