mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
review updates (1)
This commit is contained in:
@@ -84,6 +84,7 @@ public class FilePlanComponent
|
||||
|
||||
@JsonProperty (value = ALLOWABLE_OPERATIONS)
|
||||
private List<String> allowableOperations;
|
||||
|
||||
private FilePlanComponentPath path;
|
||||
|
||||
@JsonProperty (required = true)
|
||||
@@ -203,7 +204,7 @@ public class FilePlanComponent
|
||||
/**
|
||||
* @return the isCategory
|
||||
*/
|
||||
public Boolean isIsCategory()
|
||||
public Boolean isCategory()
|
||||
{
|
||||
return this.isCategory;
|
||||
}
|
||||
@@ -219,7 +220,7 @@ public class FilePlanComponent
|
||||
/**
|
||||
* @return the isRecordFolder
|
||||
*/
|
||||
public Boolean isIsRecordFolder()
|
||||
public Boolean isRecordFolder()
|
||||
{
|
||||
return this.isRecordFolder;
|
||||
}
|
||||
@@ -235,7 +236,7 @@ public class FilePlanComponent
|
||||
/**
|
||||
* @return the isFile
|
||||
*/
|
||||
public Boolean isIsFile()
|
||||
public Boolean isFile()
|
||||
{
|
||||
return this.isFile;
|
||||
}
|
||||
@@ -251,7 +252,7 @@ public class FilePlanComponent
|
||||
/**
|
||||
* @return the hasRetentionSchedule
|
||||
*/
|
||||
public Boolean isHasRetentionSchedule()
|
||||
public Boolean hasRetentionSchedule()
|
||||
{
|
||||
return this.hasRetentionSchedule;
|
||||
}
|
||||
|
@@ -58,13 +58,16 @@ public class PojoUtility
|
||||
//return the json object
|
||||
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(model);
|
||||
|
||||
} catch (JsonGenerationException e)
|
||||
}
|
||||
catch (JsonGenerationException e)
|
||||
{
|
||||
return e.toString();
|
||||
} catch (JsonMappingException e)
|
||||
}
|
||||
catch (JsonMappingException e)
|
||||
{
|
||||
return e.toString();
|
||||
} catch (IOException e)
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
return e.toString();
|
||||
}
|
||||
|
@@ -122,7 +122,7 @@ public class BaseRestTest extends RestTest
|
||||
rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
|
||||
// Create the RM site
|
||||
RMSite rmSite= new RMSite(RM_TITLE, RM_DESCRIPTION, STANDARD);
|
||||
RMSite rmSite = new RMSite(RM_TITLE, RM_DESCRIPTION, STANDARD);
|
||||
rmSiteAPI.createRMSite(rmSite);
|
||||
|
||||
// Verify the status code
|
||||
@@ -183,7 +183,7 @@ public class BaseRestTest extends RestTest
|
||||
{
|
||||
RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
|
||||
FilePlanComponent filePlanComponent=new FilePlanComponent(componentName, componentType.toString(),new FilePlanComponentProperties(componentTitle));
|
||||
FilePlanComponent filePlanComponent = new FilePlanComponent(componentName, componentType.toString(),new FilePlanComponentProperties(componentTitle));
|
||||
|
||||
FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(filePlanComponent, parentComponentId);
|
||||
restWrapper.assertStatusCodeIs(CREATED);
|
||||
|
@@ -199,7 +199,7 @@ public class FilePlanTests extends BaseRestTest
|
||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
|
||||
// Build object for updating the filePlan
|
||||
FilePlanComponent filePlanComponent= new FilePlanComponent();
|
||||
FilePlanComponent filePlanComponent = new FilePlanComponent();
|
||||
FilePlanComponentProperties filePlanComponentProperties=new FilePlanComponentProperties(FILE_PLAN_TITLE, FILE_PLAN_DESCRIPTION);
|
||||
filePlanComponent.setProperties(filePlanComponentProperties);
|
||||
|
||||
@@ -287,7 +287,7 @@ public class FilePlanTests extends BaseRestTest
|
||||
dataProviderClass = TestData.class,
|
||||
dataProvider = "getContainersAndTypes"
|
||||
)
|
||||
@Bug(id="RM-4296")
|
||||
@Bug(id = "RM-4296")
|
||||
public void createFilePlanSpecialContainerWhenExists(FilePlanComponentAlias filePlanAlias, FilePlanComponentType rmType) throws Exception
|
||||
{
|
||||
// Create RM Site if doesn't exist
|
||||
@@ -301,7 +301,7 @@ public class FilePlanTests extends BaseRestTest
|
||||
String name = filePlanAlias + getRandomAlphanumeric();
|
||||
|
||||
// Build the file plan root properties
|
||||
FilePlanComponent filePlanComponent=new FilePlanComponent(name,rmType.toString(),new FilePlanComponentProperties());
|
||||
FilePlanComponent filePlanComponent = new FilePlanComponent(name,rmType.toString(),new FilePlanComponentProperties());
|
||||
|
||||
// Authenticate with admin user
|
||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
|
@@ -94,7 +94,7 @@ public class RecordCategoryTest extends BaseRestTest
|
||||
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
||||
|
||||
// Build the record category properties
|
||||
FilePlanComponent recordCategory= new FilePlanComponent(categoryName,RECORD_CATEGORY_TYPE.toString(),
|
||||
FilePlanComponent recordCategory = new FilePlanComponent(categoryName,RECORD_CATEGORY_TYPE.toString(),
|
||||
new FilePlanComponentProperties(categoryTitle));
|
||||
// Create the record category
|
||||
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(recordCategory, FILE_PLAN_ALIAS.toString());
|
||||
@@ -103,9 +103,9 @@ public class RecordCategoryTest extends BaseRestTest
|
||||
restWrapper.assertStatusCodeIs(CREATED);
|
||||
|
||||
// Verify the returned file plan component
|
||||
assertTrue(filePlanComponent.isIsCategory());
|
||||
assertFalse(filePlanComponent.isIsFile());
|
||||
assertFalse(filePlanComponent.isIsRecordFolder());
|
||||
assertTrue(filePlanComponent.isCategory());
|
||||
assertFalse(filePlanComponent.isFile());
|
||||
assertFalse(filePlanComponent.isRecordFolder());
|
||||
|
||||
assertEquals(filePlanComponent.getName(), categoryName);
|
||||
assertEquals(filePlanComponent.getNodeType(), RECORD_CATEGORY_TYPE.toString());
|
||||
@@ -226,9 +226,9 @@ public class RecordCategoryTest extends BaseRestTest
|
||||
|
||||
// Verify child category
|
||||
assertEquals(childCategory.getParentId(), rootCategory.getId());
|
||||
assertTrue(childCategory.isIsCategory());
|
||||
assertFalse(childCategory.isIsFile());
|
||||
assertFalse(childCategory.isIsRecordFolder());
|
||||
assertTrue(childCategory.isCategory());
|
||||
assertFalse(childCategory.isFile());
|
||||
assertFalse(childCategory.isRecordFolder());
|
||||
assertEquals(childCategory.getNodeType(), RECORD_CATEGORY_TYPE.toString());
|
||||
}
|
||||
|
||||
@@ -295,19 +295,19 @@ public class RecordCategoryTest extends BaseRestTest
|
||||
assertEquals(filePlanComponent.getParentId(), rootCategory.getId());
|
||||
|
||||
// Only categories or folders have been created
|
||||
assertFalse(filePlanComponent.isIsFile());
|
||||
assertFalse(filePlanComponent.isFile());
|
||||
|
||||
// Boolean properties related to node type
|
||||
// Only RECORD_CATEGORY_TYPE and RECORD_FOLDER_TYPE have been created
|
||||
if (filePlanComponent.getNodeType().equals(RECORD_CATEGORY_TYPE.toString()))
|
||||
{
|
||||
assertTrue(filePlanComponent.isIsCategory());
|
||||
assertFalse(filePlanComponent.isIsRecordFolder());
|
||||
assertTrue(filePlanComponent.isCategory());
|
||||
assertFalse(filePlanComponent.isRecordFolder());
|
||||
}
|
||||
else
|
||||
{
|
||||
assertTrue(filePlanComponent.isIsRecordFolder());
|
||||
assertFalse(filePlanComponent.isIsCategory());
|
||||
assertTrue(filePlanComponent.isRecordFolder());
|
||||
assertFalse(filePlanComponent.isCategory());
|
||||
}
|
||||
|
||||
// Does returned object have the same contents as the created one?
|
||||
@@ -339,7 +339,7 @@ public class RecordCategoryTest extends BaseRestTest
|
||||
@Bug (id="RM-4367")
|
||||
public void createTypesNotAllowedInCategory(String nodeType) throws Exception
|
||||
{
|
||||
String COMPONENT_NAME="Component"+getRandomAlphanumeric();
|
||||
String COMPONENT_NAME = "Component"+getRandomAlphanumeric();
|
||||
|
||||
// Authenticate with admin user
|
||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
|
@@ -91,7 +91,7 @@ public class RecordFolderTests extends BaseRestTest
|
||||
String CATEGORY = CATEGORY_NAME + getRandomAlphanumeric();
|
||||
// Authenticate with admin user
|
||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
FilePlanComponent filePlanComponent=createCategory(FILE_PLAN_ALIAS.toString(), CATEGORY);
|
||||
FilePlanComponent filePlanComponent = createCategory(FILE_PLAN_ALIAS.toString(), CATEGORY);
|
||||
|
||||
FilePlanComponentProperties filePlanComponentProperties = new FilePlanComponentProperties(FOLDER_TITLE);
|
||||
FilePlanComponent recordFolder = new FilePlanComponent(FOLDER_NAME,RECORD_FOLDER_TYPE.toString(), filePlanComponentProperties);
|
||||
@@ -99,15 +99,15 @@ public class RecordFolderTests extends BaseRestTest
|
||||
// Create the record folder
|
||||
FilePlanComponent folder = filePlanComponentAPI.createFilePlanComponent(recordFolder, filePlanComponent.getId());
|
||||
|
||||
//filePlanComponentAPI.createFilePlanComponent(recordFolderProperties, filePlanComponent.getId());
|
||||
|
||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
||||
|
||||
// Check folder has been created within the category created
|
||||
assertEquals(filePlanComponent.getId(),folder.getParentId());
|
||||
// Verify the returned properties for the file plan component - record folder
|
||||
assertFalse(folder.isIsCategory());
|
||||
assertFalse(folder.isIsFile());
|
||||
assertTrue(folder.isIsRecordFolder());
|
||||
assertFalse(folder.isCategory());
|
||||
assertFalse(folder.isFile());
|
||||
assertTrue(folder.isRecordFolder());
|
||||
|
||||
assertEquals(folder.getName(), FOLDER_NAME);
|
||||
assertEquals(folder.getNodeType(), RECORD_FOLDER_TYPE.toString());
|
||||
@@ -138,7 +138,7 @@ public class RecordFolderTests extends BaseRestTest
|
||||
String componentID = filePlanComponentAPI.getFilePlanComponent(filePlanComponent).getId();
|
||||
|
||||
// Build the record category properties
|
||||
FilePlanComponent recordFolder= new FilePlanComponent(FOLDER_NAME,RECORD_FOLDER_TYPE.toString(),
|
||||
FilePlanComponent recordFolder = new FilePlanComponent(FOLDER_NAME,RECORD_FOLDER_TYPE.toString(),
|
||||
new FilePlanComponentProperties(FOLDER_TITLE));
|
||||
// Create a record folder
|
||||
filePlanComponentAPI.createFilePlanComponent(recordFolder, componentID);
|
||||
@@ -158,19 +158,19 @@ public class RecordFolderTests extends BaseRestTest
|
||||
)
|
||||
public void checkTheRecordFolderProperties() throws Exception
|
||||
{
|
||||
String CATEGORY=CATEGORY_NAME + getRandomAlphanumeric();
|
||||
String CATEGORY = CATEGORY_NAME + getRandomAlphanumeric();
|
||||
// Authenticate with admin user
|
||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
FilePlanComponent category = createCategory(FILE_PLAN_ALIAS.toString(), CATEGORY);
|
||||
FilePlanComponent folder =createFolder(category.getId(),FOLDER_NAME);
|
||||
FilePlanComponent folder = createFolder(category.getId(),FOLDER_NAME);
|
||||
|
||||
FilePlanComponent folderDetails=filePlanComponentAPI.withParams("include="+IS_CLOSED).getFilePlanComponent(folder.getId());
|
||||
FilePlanComponent folderDetails = filePlanComponentAPI.withParams("include="+IS_CLOSED).getFilePlanComponent(folder.getId());
|
||||
|
||||
// Verify the returned properties for the file plan component - record folder
|
||||
assertEquals(RECORD_FOLDER_TYPE.toString(),folderDetails.getNodeType());
|
||||
assertTrue(folderDetails.isIsRecordFolder());
|
||||
assertFalse(folderDetails.isIsCategory());
|
||||
assertFalse(folderDetails.isIsFile());
|
||||
assertTrue(folderDetails.isRecordFolder());
|
||||
assertFalse(folderDetails.isCategory());
|
||||
assertFalse(folderDetails.isFile());
|
||||
assertFalse(folderDetails.isClosed());
|
||||
|
||||
assertEquals(FOLDER_NAME,folderDetails.getName());
|
||||
@@ -205,12 +205,12 @@ public class RecordFolderTests extends BaseRestTest
|
||||
|
||||
// Create record category first
|
||||
String folderDescription = "The folder description is updated" + getRandomAlphanumeric();
|
||||
String folderName= "The folder name is updated" + getRandomAlphanumeric();
|
||||
String folderName = "The folder name is updated" + getRandomAlphanumeric();
|
||||
String folderTitle = "Update title " + getRandomAlphanumeric();
|
||||
String location="Location"+getRandomAlphanumeric();
|
||||
String location = "Location"+getRandomAlphanumeric();
|
||||
|
||||
//Create the file plan component properties to update
|
||||
FilePlanComponentProperties filePlanComponentProperties= new FilePlanComponentProperties(folderTitle, folderDescription);
|
||||
FilePlanComponentProperties filePlanComponentProperties = new FilePlanComponentProperties(folderTitle, folderDescription);
|
||||
filePlanComponentProperties.setVitalRecord(true);
|
||||
filePlanComponentProperties.setReviewPeriod( new ReviewPeriod("month","1"));
|
||||
filePlanComponentProperties.setLocation(location);
|
||||
@@ -231,7 +231,6 @@ public class RecordFolderTests extends BaseRestTest
|
||||
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getPeriodType());
|
||||
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getExpression());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -325,11 +324,11 @@ public class RecordFolderTests extends BaseRestTest
|
||||
|
||||
// Is parent Id set correctly
|
||||
assertEquals(filePlanComponent.getParentId(), category.getId());
|
||||
assertFalse(filePlanComponent.isIsFile());
|
||||
assertFalse(filePlanComponent.isFile());
|
||||
|
||||
// Boolean properties related to node type
|
||||
assertTrue(filePlanComponent.isIsRecordFolder());
|
||||
assertFalse(filePlanComponent.isIsCategory());
|
||||
assertTrue(filePlanComponent.isRecordFolder());
|
||||
assertFalse(filePlanComponent.isCategory());
|
||||
|
||||
assertEquals(createdComponent.getName(), filePlanComponent.getName());
|
||||
assertEquals(createdComponent.getNodeType(), filePlanComponent.getNodeType());
|
||||
|
@@ -117,9 +117,9 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
||||
|
||||
// Verify the returned file plan component
|
||||
assertFalse(filePlanComponent.isIsCategory());
|
||||
assertFalse(filePlanComponent.isIsFile());
|
||||
assertFalse(filePlanComponent.isIsRecordFolder()); // it is not a _normal_ record folder!
|
||||
assertFalse(filePlanComponent.isCategory());
|
||||
assertFalse(filePlanComponent.isFile());
|
||||
assertFalse(filePlanComponent.isRecordFolder()); // it is not a _normal_ record folder!
|
||||
|
||||
assertEquals(filePlanComponent.getName(), folderName);
|
||||
assertEquals(filePlanComponent.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString());
|
||||
@@ -200,9 +200,9 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
||||
restWrapper.assertStatusCodeIs(CREATED);
|
||||
|
||||
// Verify the returned file plan component
|
||||
assertFalse(childFolder.isIsCategory());
|
||||
assertFalse(childFolder.isIsFile());
|
||||
assertFalse(childFolder.isIsRecordFolder()); // it is not a _normal_ record folder!
|
||||
assertFalse(childFolder.isCategory());
|
||||
assertFalse(childFolder.isFile());
|
||||
assertFalse(childFolder.isRecordFolder()); // it is not a _normal_ record folder!
|
||||
|
||||
assertEquals(childFolder.getName(), childFolderName);
|
||||
assertEquals(childFolder.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString());
|
||||
@@ -251,7 +251,7 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
||||
assertEquals(folderName, folderToModify.getName());
|
||||
|
||||
// Build the properties which will be updated
|
||||
FilePlanComponent folderToUpdate=new FilePlanComponent(modified + folderToModify.getName(),
|
||||
FilePlanComponent folderToUpdate = new FilePlanComponent(modified + folderToModify.getName(),
|
||||
new FilePlanComponentProperties(modified + folderToModify.getProperties().getTitle(),
|
||||
modified + folderToModify.getProperties().getDescription()));
|
||||
// Update the unfiled records folder
|
||||
|
@@ -96,7 +96,7 @@ public class RMSiteTests extends BaseRestTest
|
||||
|
||||
// Create the RM site
|
||||
RMSite rmSite = new RMSite(RM_TITLE, RM_DESCRIPTION, STANDARD);
|
||||
RMSite rmSiteResponse=rmSiteAPI.createRMSite(rmSite);
|
||||
RMSite rmSiteResponse = rmSiteAPI.createRMSite(rmSite);
|
||||
|
||||
// Verify the status code
|
||||
rmSiteAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
||||
@@ -262,7 +262,7 @@ public class RMSiteTests extends BaseRestTest
|
||||
public void updateRMSiteDetails()throws Exception
|
||||
{
|
||||
String NEW_TITLE = RM_TITLE + RandomData.getRandomAlphanumeric();
|
||||
String NEW_DESCRIPTION=RM_DESCRIPTION+ RandomData.getRandomAlphanumeric();
|
||||
String NEW_DESCRIPTION = RM_DESCRIPTION+ RandomData.getRandomAlphanumeric();
|
||||
|
||||
// Authenticate with admin user
|
||||
rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||
@@ -271,7 +271,7 @@ public class RMSiteTests extends BaseRestTest
|
||||
createRMSiteIfNotExists();
|
||||
|
||||
//Create RM site model
|
||||
RMSite rmSiteToUpdate=new RMSite();
|
||||
RMSite rmSiteToUpdate = new RMSite();
|
||||
rmSiteToUpdate.setTitle(NEW_TITLE);
|
||||
rmSiteToUpdate.setDescription(NEW_DESCRIPTION);
|
||||
|
||||
|
Reference in New Issue
Block a user