From 793bdd64da424d39cff67327db6f1dc6fa04f43e Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Fri, 4 Nov 2016 15:36:55 +0200 Subject: [PATCH] RM-4296 - removed redundant parent type checked --- .../model/rma/type/FilePlanType.java | 12 ++---------- .../model/rma/type/FilePlanTypeUnitTest.java | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanType.java index 841a1db57b..9ff345353b 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanType.java @@ -155,16 +155,8 @@ public class FilePlanType extends BaseBehaviourBean @Override public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean bNew) { - // ensure we only add categories and special containers as fileplan children - NodeRef child = childAssocRef.getChildRef(); - NodeRef parent = childAssocRef.getParentRef(); - if (!getFilePlanService().isFilePlan(parent)) - { - return; - } - - // list of the accepted types of fileplan children - validateNewChildAssociation(parent, child, ACCEPTED_UNIQUE_CHILD_TYPES, ACCEPTED_NON_UNIQUE_CHILD_TYPES); + // check the created child is of an accepted type + validateNewChildAssociation(childAssocRef.getParentRef(), childAssocRef.getChildRef(), ACCEPTED_UNIQUE_CHILD_TYPES, ACCEPTED_NON_UNIQUE_CHILD_TYPES); } /** diff --git a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java index 31d86a63fa..bdad80df6e 100644 --- a/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java +++ b/rm-community/rm-community-repo/unit-test/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/FilePlanTypeUnitTest.java @@ -62,7 +62,6 @@ public class FilePlanTypeUnitTest extends BaseUnitTest public void setup() { filePlanContainer = generateNodeRef(TYPE_FILE_PLAN, true); - when(mockedFilePlanService.isFilePlan(filePlanContainer)).thenReturn(true); } /**