RM-4619 - updated unit tests

This commit is contained in:
Ana Bozianu
2017-02-27 16:17:22 +02:00
parent 7e08ee2f98
commit 950c0028f3
3 changed files with 143 additions and 29 deletions

View File

@@ -137,7 +137,7 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
final NodeRef child = childAssocRef.getChildRef();
if (nodeService.exists(child))
{
QName childType = convertNodeToFileplanComponent(child, nodeService.getType(child), nodeService.getType(childAssocRef.getParentRef()));
QName childType = convertNodeToFileplanComponent(childAssocRef);
// We only care about "folder" or sub-types that are not hidden.
// Some modules use hidden files to store information (see RM-3283)
@@ -211,13 +211,15 @@ public class RecordsManagementContainerType extends BaseBehaviourBean
* The conversion is needed here to be able to generate the identifier
* If there is no conversion rule for the created type nothing happens and the current type is returned
*
* @param child ref to the new child
* @param childType the type of the new child
* @param parentType the type of the parent node
* @param childAssocRef reference to the new association
* @return the new type of the child node
*/
protected QName convertNodeToFileplanComponent(final NodeRef child, final QName childType, final QName parentType)
protected QName convertNodeToFileplanComponent(final ChildAssociationRef childAssocRef)
{
NodeRef child = childAssocRef.getChildRef();
QName childType = nodeService.getType(child);
QName parentType = nodeService.getType(childAssocRef.getParentRef());
if(childType.equals(ContentModel.TYPE_FOLDER))
{
if(parentType.equals(TYPE_FILE_PLAN))