From ec580a1db45ecc61d3a0a42c1145497947b032d4 Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Sat, 29 Apr 2017 12:57:29 +0300 Subject: [PATCH] RM-5012 - fixed tests --- .../test/integration/issue/RM4619Test.java | 49 ++++++++----------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4619Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4619Test.java index 9e55647d26..722bee2982 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4619Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4619Test.java @@ -59,24 +59,19 @@ public class RM4619Test extends BaseRMTestCase public NodeRef run() throws Exception { FileInfo info = fileFolderService.create(filePlan, GUID.generate(), TYPE_FOLDER); - assertEquals(TYPE_RECORD_CATEGORY, info.getType()); - assertNotNull(info.getProperties().get(PROP_IDENTIFIER)); return info.getNodeRef(); } }, ADMIN_USER); - /* - * Check that when the transaction ends the identifier is no longer editable - */ doTestInTransaction(new Test() { @Override public Void run() throws Exception { - assertFalse((Boolean)nodeService.getProperty(recordCategory, PROP_ID_IS_TEMPORARILY_EDITABLE)); + assertEquals(TYPE_RECORD_CATEGORY, nodeService.getType(recordCategory)); + assertNotNull(nodeService.getProperty(recordCategory, PROP_IDENTIFIER)); return null; } - }, ADMIN_USER); } @@ -88,7 +83,7 @@ public class RM4619Test extends BaseRMTestCase public void testConvertFolderToRecordFolder() throws Exception { /* - * Create a folder in a record category and check it is immediately converted + * Create a folder in a record category and check it is converted */ final NodeRef recordFolder = doTestInTransaction(new Test() { @@ -96,12 +91,21 @@ public class RM4619Test extends BaseRMTestCase public NodeRef run() throws Exception { FileInfo info = fileFolderService.create(rmContainer, GUID.generate(), TYPE_FOLDER); - assertEquals(TYPE_RECORD_FOLDER, info.getType()); - assertNotNull(info.getProperties().get(PROP_IDENTIFIER)); return info.getNodeRef(); } }, ADMIN_USER); + doTestInTransaction(new Test() + { + @Override + public Void run() throws Exception + { + assertEquals(TYPE_RECORD_FOLDER, nodeService.getType(recordFolder)); + assertNotNull(nodeService.getProperty(recordFolder, PROP_IDENTIFIER)); + return null; + } + }, ADMIN_USER); + /* * Check that when the transaction ends the identifier is no longer editable * And the record folder has the ASPECT_RM_SEARCH aspect @@ -111,7 +115,6 @@ public class RM4619Test extends BaseRMTestCase @Override public Void run() throws Exception { - assertFalse((Boolean)nodeService.getProperty(recordFolder, PROP_ID_IS_TEMPORARILY_EDITABLE)); assertTrue(nodeService.hasAspect(recordFolder, ASPECT_RM_SEARCH)); return null; } @@ -122,15 +125,15 @@ public class RM4619Test extends BaseRMTestCase /** * Given the RM site is created * When we create a regular folder in the unfiled record container - * Then the folder is immediately converted to a unfiled record folder + * Then the folder is converted to a unfiled record folder * * And when we create another regular folder in that unfiled record folder - * Then the folder is also immediately converted to a unfiled record folder + * Then the folder is also converted to a unfiled record folder */ public void testConvertFolderToUnfiledRecordFolder() throws Exception { /* - * Create a folder in the unfiled record container and check it is immediately converted + * Create a folder in the unfiled record container and check it is converted */ final NodeRef folder1 = doTestInTransaction(new Test() { @@ -138,24 +141,19 @@ public class RM4619Test extends BaseRMTestCase public NodeRef run() throws Exception { FileInfo folder = fileFolderService.create(unfiledContainer, GUID.generate(), TYPE_FOLDER); - assertEquals(TYPE_UNFILED_RECORD_FOLDER, folder.getType()); - assertNotNull(folder.getProperties().get(PROP_IDENTIFIER)); return folder.getNodeRef(); } }, ADMIN_USER); - /* - * Check that when the transaction ends the identified is no longer editable - */ doTestInTransaction(new Test() { @Override public Void run() throws Exception { - assertFalse((Boolean)nodeService.getProperty(folder1, PROP_ID_IS_TEMPORARILY_EDITABLE)); + assertEquals(TYPE_UNFILED_RECORD_FOLDER, nodeService.getType(folder1)); + assertNotNull(nodeService.getProperty(folder1, PROP_IDENTIFIER)); return null; } - }, ADMIN_USER); /* @@ -167,24 +165,19 @@ public class RM4619Test extends BaseRMTestCase public NodeRef run() throws Exception { FileInfo folder = fileFolderService.create(folder1, GUID.generate(), TYPE_FOLDER); - assertEquals(TYPE_UNFILED_RECORD_FOLDER, folder.getType()); - assertNotNull(folder.getProperties().get(PROP_IDENTIFIER)); return folder.getNodeRef(); } }, ADMIN_USER); - /* - * Check that when the transaction ends the identified is no longer editable - */ doTestInTransaction(new Test() { @Override public Void run() throws Exception { - assertFalse((Boolean)nodeService.getProperty(folder2, PROP_ID_IS_TEMPORARILY_EDITABLE)); + assertEquals(TYPE_UNFILED_RECORD_FOLDER, nodeService.getType(folder2)); + assertNotNull(nodeService.getProperty(folder2, PROP_IDENTIFIER)); return null; } - }, ADMIN_USER); } }