mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge remote-tracking branch 'origin/feature/RM-4396_UseModelInsteadJsonObject' into feature/RM-4396_Lombok_UseModelInsteadJsonObject
Conflicts: rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/rm/community/model/fileplancomponents/FilePlanComponent.java rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRestTest.java rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/FilePlanTests.java rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordCategoryTest.java rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/RecordFolderTests.java rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/UnfiledRecordsFolderTests.java
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
<properties>
|
||||
<alfresco.rm.share>alfresco-rm-community-share</alfresco.rm.share>
|
||||
<alfresco.rm.repo>alfresco-rm-community-repo</alfresco.rm.repo>
|
||||
<tas.restapi.version>5.2.0-0</tas.restapi.version>
|
||||
<fluent.json.version>2.0.0</fluent.json.version>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@@ -34,18 +36,18 @@
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>restapi-test</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>${tas.restapi.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.alfresco.tas</groupId>
|
||||
<artifactId>restapi-test</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>${tas.restapi.version}</version>
|
||||
<type>test-jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jglue.fluent-json</groupId>
|
||||
<artifactId>fluent-json</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<version>${fluent.json.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
|
@@ -93,6 +93,7 @@ public class FilePlanComponent
|
||||
|
||||
@JsonProperty (value = ALLOWABLE_OPERATIONS)
|
||||
private List<String> allowableOperations;
|
||||
|
||||
private FilePlanComponentPath path;
|
||||
|
||||
@JsonProperty (required = true)
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -61,7 +61,8 @@ import org.testng.annotations.BeforeClass;
|
||||
* @since 2.6
|
||||
*/
|
||||
@Configuration
|
||||
@PropertySource("classpath:default.properties")
|
||||
@PropertySource(value = {"classpath:default.properties", "classpath:config.properties"})
|
||||
@PropertySource(value = "classpath:module.properties", ignoreResourceNotFound = true)
|
||||
@PropertySource(value = "classpath:local.properties", ignoreResourceNotFound = true)
|
||||
public class BaseRestTest extends RestTest
|
||||
{
|
||||
@@ -121,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
|
||||
|
@@ -290,7 +290,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
|
||||
|
@@ -359,7 +359,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);
|
||||
|
||||
FilePlanComponent recordFolder = FilePlanComponent.builder()
|
||||
.name(FOLDER_NAME)
|
||||
@@ -104,7 +104,7 @@ 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
|
||||
@@ -169,13 +169,13 @@ 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());
|
||||
@@ -216,9 +216,9 @@ 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
|
||||
FilePlanComponent recordFolder = FilePlanComponent.builder()
|
||||
@@ -247,7 +247,6 @@ public class RecordFolderTests extends BaseRestTest
|
||||
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getPeriodType());
|
||||
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getExpression());
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -0,0 +1,2 @@
|
||||
alfresco.server=localhost
|
||||
rest.rmPath=alfresco/api/-default-/public/ig/versions/1
|
@@ -1,25 +0,0 @@
|
||||
#########################################################################
|
||||
# Original property values from default.properties #
|
||||
#########################################################################
|
||||
|
||||
# Dataprep related
|
||||
alfresco.scheme=http
|
||||
alfresco.server=localhost
|
||||
alfresco.port=8080
|
||||
|
||||
# Credentials
|
||||
admin.user=admin
|
||||
admin.password=admin
|
||||
|
||||
# Rest related
|
||||
rest.basePath=alfresco/api/-default-/public/alfresco/versions/1
|
||||
rest.workflowPath=alfresco/api/-default-/public/workflow/versions/1
|
||||
|
||||
# Database Section
|
||||
db.url = jdbc:mysql://${alfresco.server}:3306/alfresco
|
||||
db.username = alfresco
|
||||
db.password = alfresco
|
||||
|
||||
#########################################################################
|
||||
|
||||
rest.rmPath=alfresco/api/-default-/public/ig/versions/1
|
Reference in New Issue
Block a user