mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4619 - replaced unit tests with integration tests
This commit is contained in:
@@ -182,29 +182,6 @@ public class FilePlanTypeUnitTest extends BaseUnitTest
|
||||
filePlanType.onCreateChildAssociation(childAssoc, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given that we try to add "cm:folder" type to a record category,
|
||||
* Then operation is successful and the folder is automatically converted to a record folder
|
||||
*/
|
||||
@Test
|
||||
public void testConversionToRecordFolder() throws Exception
|
||||
{
|
||||
NodeRef fileplan = AlfMock.generateNodeRef(mockedNodeService, TYPE_FILE_PLAN);
|
||||
NodeRef nodeRef = AlfMock.generateNodeRef(mockedNodeService, TYPE_FOLDER, true);
|
||||
ChildAssociationRef childAssocRef = generateChildAssociationRef(fileplan, nodeRef);
|
||||
|
||||
try
|
||||
{
|
||||
filePlanType.onCreateChildAssociation(childAssocRef, true);
|
||||
}
|
||||
catch(IntegrityException ex)
|
||||
{
|
||||
// this will throw an exception because unit tests can't detect type change
|
||||
}
|
||||
|
||||
verify(mockedNodeService).setType(nodeRef, TYPE_RECORD_CATEGORY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method that creates a child of the fileplan container with the provided type
|
||||
* @param childType the node type of the child to be created
|
||||
|
@@ -109,27 +109,4 @@ public class RecordCategoryTypeUnitTest extends BaseUnitTest
|
||||
ChildAssociationRef childAssocRef = generateChildAssociationRef(recordCategoryNodeRef, nodeRef);
|
||||
recordCategoryType.onCreateChildAssociation(childAssocRef, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Given that we try to add "cm:folder" type to a record category,
|
||||
* Then operation is successful and the folder is automatically converted to a record folder
|
||||
*/
|
||||
@Test
|
||||
public void testConversionToRecordFolder() throws Exception
|
||||
{
|
||||
NodeRef recordCategoryNodeRef = AlfMock.generateNodeRef(mockedNodeService, TYPE_RECORD_CATEGORY);
|
||||
NodeRef nodeRef = AlfMock.generateNodeRef(mockedNodeService, TYPE_FOLDER, true);
|
||||
ChildAssociationRef childAssocRef = generateChildAssociationRef(recordCategoryNodeRef, nodeRef);
|
||||
|
||||
try
|
||||
{
|
||||
recordCategoryType.onCreateChildAssociation(childAssocRef, true);
|
||||
}
|
||||
catch(IntegrityException ex)
|
||||
{
|
||||
// this will throw an exception because unit tests can't detect type change
|
||||
}
|
||||
|
||||
verify(mockedNodeService).setType(nodeRef, TYPE_RECORD_FOLDER);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user