mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
fix the community rest api tests that use data providers from TestData.class
This commit is contained in:
@@ -26,22 +26,8 @@
|
||||
*/
|
||||
package org.alfresco.rest.rm.community.base;
|
||||
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_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.CONTENT_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FILE_PLAN_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FOLDER_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.TRANSFER_CONTAINER_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.TRANSFER_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.utility.data.RandomData.getRandomAlphanumeric;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
|
||||
/**
|
||||
* Test data used in tests
|
||||
*
|
||||
@@ -67,20 +53,6 @@ public interface TestData
|
||||
public static final String DEFAULT_EMAIL = "default@alfresco.com";
|
||||
|
||||
/**
|
||||
* Data Provider with the special file plan components alias
|
||||
* @return file plan component alias
|
||||
*/
|
||||
@DataProvider
|
||||
public static String[][] getContainers()
|
||||
{
|
||||
return new String[][] {
|
||||
{ FILE_PLAN_ALIAS },
|
||||
{ TRANSFERS_ALIAS },
|
||||
{ UNFILED_RECORDS_CONTAINER_ALIAS },
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The default record category name used when creating categories
|
||||
*/
|
||||
public static String RECORD_CATEGORY_NAME = "CATEGORY NAME" + getRandomAlphanumeric();
|
||||
@@ -110,89 +82,5 @@ public interface TestData
|
||||
*/
|
||||
public static String NONELECTRONIC_RECORD_NAME = "Record nonelectronic" + getRandomAlphanumeric();
|
||||
|
||||
/**
|
||||
* Data Provider with:
|
||||
* with the object types not allowed as children for a record category
|
||||
*
|
||||
* @return file plan component alias
|
||||
*/
|
||||
@DataProvider
|
||||
public static String[][] childrenNotAllowedForCategory()
|
||||
{
|
||||
return new String[][] {
|
||||
{ FILE_PLAN_TYPE },
|
||||
{ TRANSFER_CONTAINER_TYPE },
|
||||
{ UNFILED_CONTAINER_TYPE },
|
||||
{ UNFILED_RECORD_FOLDER_TYPE },
|
||||
{ TRANSFER_TYPE },
|
||||
{ CONTENT_TYPE }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Provider with:
|
||||
* with the object types for creating a Record Folder
|
||||
*
|
||||
* @return file plan component alias
|
||||
*/
|
||||
@DataProvider
|
||||
public static String[][] folderTypes()
|
||||
{
|
||||
return new String[][] {
|
||||
{ RECORD_FOLDER_TYPE },
|
||||
{ FOLDER_TYPE }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Provider with:
|
||||
* with the object types for creating a Record Category
|
||||
*
|
||||
* @return file plan component alias
|
||||
*/
|
||||
@DataProvider
|
||||
public static String[][] categoryTypes()
|
||||
{
|
||||
return new String[][] {
|
||||
{ FOLDER_TYPE },
|
||||
{ RECORD_CATEGORY_TYPE }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Provider with:
|
||||
* with the object types for creating a Record Category Child
|
||||
*
|
||||
* @return record category child type
|
||||
*/
|
||||
@DataProvider
|
||||
public static Object[][] categoryChild()
|
||||
{
|
||||
return new String[][] {
|
||||
{ RECORD_FOLDER_TYPE },
|
||||
{ FOLDER_TYPE },
|
||||
{ RECORD_CATEGORY_TYPE }
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalid root level types, at unfiled record folder/unfiled containers container level that shouldn't be possible to create
|
||||
*/
|
||||
@DataProvider (name = "invalidRootTypes")
|
||||
public static Object[][] getInvalidRootTypes()
|
||||
{
|
||||
return new String[][]
|
||||
{
|
||||
{ FILE_PLAN_TYPE },
|
||||
{ RECORD_CATEGORY_TYPE },
|
||||
{ RECORD_FOLDER_TYPE },
|
||||
{ TRANSFER_CONTAINER_TYPE },
|
||||
{ TRANSFER_TYPE },
|
||||
{ UNFILED_CONTAINER_TYPE },
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public static final String ALFRESCO_ADMINISTRATORS = "ALFRESCO_ADMINISTRATORS";
|
||||
}
|
||||
|
@@ -62,7 +62,7 @@ import java.util.ArrayList;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
|
||||
import org.alfresco.rest.rm.community.base.TestData;
|
||||
import org.alfresco.rest.rm.community.base.DataProviderClass;
|
||||
import org.alfresco.rest.rm.community.model.fileplan.FilePlan;
|
||||
import org.alfresco.rest.rm.community.model.fileplan.FilePlanProperties;
|
||||
import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType;
|
||||
@@ -291,7 +291,7 @@ public class FilePlanTests extends BaseRMRestTest
|
||||
@Test
|
||||
(
|
||||
description = "Create root category",
|
||||
dataProviderClass = TestData.class,
|
||||
dataProviderClass = DataProviderClass.class,
|
||||
dataProvider = "categoryTypes"
|
||||
)
|
||||
public void createFilePlanChildren(String nodeType) throws Exception
|
||||
|
@@ -32,7 +32,8 @@ import static org.alfresco.rest.rm.community.base.TestData.RECORD_CATEGORY_NAME;
|
||||
import static org.alfresco.rest.rm.community.base.TestData.RECORD_FOLDER_NAME;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_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.FilePlanComponentAlias
|
||||
.UNFILED_RECORDS_CONTAINER_ALIAS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PATH;
|
||||
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;
|
||||
@@ -59,8 +60,9 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.alfresco.rest.core.v0.BaseAPI.RETENTION_SCHEDULE;
|
||||
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
|
||||
import org.alfresco.rest.rm.community.base.TestData;
|
||||
import org.alfresco.rest.rm.community.base.DataProviderClass;
|
||||
import org.alfresco.rest.rm.community.model.fileplan.FilePlan;
|
||||
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategory;
|
||||
import org.alfresco.rest.rm.community.model.recordcategory.RecordCategoryChild;
|
||||
@@ -71,7 +73,6 @@ import org.alfresco.rest.rm.community.requests.gscore.api.FilePlanAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.RecordCategoryAPI;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.RecordFolderAPI;
|
||||
import org.alfresco.rest.v0.RecordCategoriesAPI;
|
||||
import org.alfresco.rest.core.v0.BaseAPI.RETENTION_SCHEDULE;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.testng.annotations.DataProvider;
|
||||
@@ -267,7 +268,7 @@ public class RecordCategoryTests extends BaseRMRestTest
|
||||
@Test
|
||||
(
|
||||
description = "Create a record folder into a record category.",
|
||||
dataProviderClass = TestData.class,
|
||||
dataProviderClass = DataProviderClass.class,
|
||||
dataProvider = "folderTypes"
|
||||
)
|
||||
@Bug (id = "RM-4572")
|
||||
@@ -299,7 +300,7 @@ public class RecordCategoryTests extends BaseRMRestTest
|
||||
}
|
||||
@Test
|
||||
(
|
||||
dataProviderClass = TestData.class,
|
||||
dataProviderClass = DataProviderClass.class,
|
||||
dataProvider = "categoryChild"
|
||||
)
|
||||
@Bug(id = "RM-5116")
|
||||
@@ -452,7 +453,7 @@ public class RecordCategoryTests extends BaseRMRestTest
|
||||
@Test
|
||||
(
|
||||
description = "Create node types not allowed inside a category",
|
||||
dataProviderClass = TestData.class,
|
||||
dataProviderClass = DataProviderClass.class,
|
||||
dataProvider = "childrenNotAllowedForCategory"
|
||||
)
|
||||
@Bug (id="RM-4367, RM-4572")
|
||||
@@ -757,7 +758,7 @@ public class RecordCategoryTests extends BaseRMRestTest
|
||||
@Test
|
||||
(
|
||||
description = "Create a record folder into transfers/unfiled/file plan container",
|
||||
dataProviderClass = TestData.class,
|
||||
dataProviderClass = DataProviderClass.class,
|
||||
dataProvider = "getContainers"
|
||||
)
|
||||
@Bug (id = "RM-4327")
|
||||
|
@@ -29,7 +29,8 @@ package org.alfresco.rest.rm.community.unfiledcontainers;
|
||||
import static java.time.LocalDateTime.now;
|
||||
|
||||
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.FilePlanComponentAlias
|
||||
.UNFILED_RECORDS_CONTAINER_ALIAS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.FOLDER_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.NON_ELECTRONIC_RECORD_TYPE;
|
||||
@@ -53,7 +54,7 @@ import java.util.List;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
|
||||
import org.alfresco.rest.rm.community.base.TestData;
|
||||
import org.alfresco.rest.rm.community.base.DataProviderClass;
|
||||
import org.alfresco.rest.rm.community.model.fileplan.FilePlan;
|
||||
import org.alfresco.rest.rm.community.model.record.RecordProperties;
|
||||
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainer;
|
||||
@@ -63,8 +64,8 @@ import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChi
|
||||
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledRecordFolder;
|
||||
import org.alfresco.rest.rm.community.requests.gscore.api.UnfiledContainerAPI;
|
||||
import org.alfresco.rest.rm.community.utils.FilePlanComponentsUtil;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.alfresco.utility.report.Bug;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.AfterMethod;
|
||||
import org.testng.annotations.DataProvider;
|
||||
@@ -418,7 +419,7 @@ public class UnfiledContainerTests extends BaseRMRestTest
|
||||
@Test
|
||||
(
|
||||
dataProvider = "invalidRootTypes",
|
||||
dataProviderClass = TestData.class,
|
||||
dataProviderClass = DataProviderClass.class,
|
||||
description = "Only unfiled records folders and records can be created as children for unfiled container root"
|
||||
)
|
||||
public void createInvalidUnfiledChildren(String filePlanComponentType)
|
||||
|
@@ -31,7 +31,8 @@ import static java.time.LocalDateTime.now;
|
||||
import static org.alfresco.rest.rm.community.base.TestData.RECORD_CATEGORY_NAME;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_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.FilePlanComponentAlias
|
||||
.UNFILED_RECORDS_CONTAINER_ALIAS;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PATH;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.NON_ELECTRONIC_RECORD_TYPE;
|
||||
@@ -57,7 +58,7 @@ import java.util.NoSuchElementException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.alfresco.rest.rm.community.base.BaseRMRestTest;
|
||||
import org.alfresco.rest.rm.community.base.TestData;
|
||||
import org.alfresco.rest.rm.community.base.DataProviderClass;
|
||||
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChild;
|
||||
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChildCollection;
|
||||
import org.alfresco.rest.rm.community.model.unfiledcontainer.UnfiledContainerChildProperties;
|
||||
@@ -190,7 +191,7 @@ public class UnfiledRecordsFolderTests extends BaseRMRestTest
|
||||
@Test
|
||||
(
|
||||
dataProvider = "invalidRootTypes",
|
||||
dataProviderClass = TestData.class,
|
||||
dataProviderClass = DataProviderClass.class,
|
||||
description = "Only unfiled records folders and records can be created as children for unfiled container root"
|
||||
)
|
||||
public void createInvalidUnfiledChildren(String filePlanComponentType) throws Exception
|
||||
|
Reference in New Issue
Block a user