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:
Tuna Aksoy
2016-11-28 21:46:48 +00:00
10 changed files with 29 additions and 46 deletions

View File

@@ -93,6 +93,7 @@ public class FilePlanComponent
@JsonProperty (value = ALLOWABLE_OPERATIONS)
private List<String> allowableOperations;
private FilePlanComponentPath path;
@JsonProperty (required = true)

View File

@@ -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();
}

View File

@@ -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

View File

@@ -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

View File

@@ -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());

View File

@@ -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());
}
/**

View File

@@ -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);

View File

@@ -0,0 +1,2 @@
alfresco.server=localhost
rest.rmPath=alfresco/api/-default-/public/ig/versions/1

View File

@@ -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