RM-4619 - replaced unit tests with integration tests

This commit is contained in:
Ana Bozianu
2017-02-07 16:24:10 +02:00
parent 5b041f31f2
commit 161ec4eaee
3 changed files with 84 additions and 46 deletions

View File

@@ -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

View File

@@ -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);
}
}