mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-4713 - It is possible to transfer content to the not enabled transfer target
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22452 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -623,6 +623,9 @@ public class TransferServiceImplTest extends BaseAlfrescoSpringTest
|
||||
* Step 6: Negative test : transfer no nodes
|
||||
* transfer (should throw exception)
|
||||
*
|
||||
* Step 7: Negative test : transfer to a disabled transfer target
|
||||
* transfer (should throw exception)
|
||||
*
|
||||
* This is a unit test so it does some shenanigans to send to the same instance of alfresco.
|
||||
*/
|
||||
public void testTransferOneNode() throws Exception
|
||||
@@ -689,6 +692,7 @@ public class TransferServiceImplTest extends BaseAlfrescoSpringTest
|
||||
{
|
||||
transferMe = transferService.getTransferTarget(targetName);
|
||||
}
|
||||
transferService.enableTransferTarget(targetName, true);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -905,7 +909,6 @@ public class TransferServiceImplTest extends BaseAlfrescoSpringTest
|
||||
endTransaction();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Step 6
|
||||
* Negative test transfer nothing
|
||||
@@ -921,7 +924,28 @@ public class TransferServiceImplTest extends BaseAlfrescoSpringTest
|
||||
{
|
||||
// expect to go here
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Step 7: Negative test : transfer to a disabled transfer target
|
||||
* transfer (should throw exception)
|
||||
*/
|
||||
logger.debug("Transfer again - with no content - should throw exception");
|
||||
try
|
||||
{
|
||||
transferService.enableTransferTarget(targetName, false);
|
||||
TransferDefinition definition = new TransferDefinition();
|
||||
|
||||
Set<NodeRef>nodes = new HashSet<NodeRef>();
|
||||
nodes.add(deletedContentNodeRef);
|
||||
definition.setNodes(nodes);
|
||||
transferService.transfer(targetName, definition);
|
||||
fail("target not enabled exception not thrown");
|
||||
}
|
||||
catch(TransferException te)
|
||||
{
|
||||
// expect to go here
|
||||
assertTrue("check contents of exception message", te.getCause().getMessage().contains("enabled"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user