RM-4296 - removed redundant parent type checked

This commit is contained in:
Ana Bozianu
2016-11-04 15:36:55 +02:00
parent 5d52f38222
commit 793bdd64da
2 changed files with 2 additions and 11 deletions

View File

@@ -155,16 +155,8 @@ public class FilePlanType extends BaseBehaviourBean
@Override @Override
public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean bNew) public void onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean bNew)
{ {
// ensure we only add categories and special containers as fileplan children // check the created child is of an accepted type
NodeRef child = childAssocRef.getChildRef(); validateNewChildAssociation(childAssocRef.getParentRef(), childAssocRef.getChildRef(), ACCEPTED_UNIQUE_CHILD_TYPES, ACCEPTED_NON_UNIQUE_CHILD_TYPES);
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);
} }
/** /**

View File

@@ -62,7 +62,6 @@ public class FilePlanTypeUnitTest extends BaseUnitTest
public void setup() public void setup()
{ {
filePlanContainer = generateNodeRef(TYPE_FILE_PLAN, true); filePlanContainer = generateNodeRef(TYPE_FILE_PLAN, true);
when(mockedFilePlanService.isFilePlan(filePlanContainer)).thenReturn(true);
} }
/** /**