ALF-11700: Possible to generate feed entries with malformed NodeRefs

* ActivityPostService checks incoming nodeRef values in JSON - they must at least work in a NodeRef constructor.
* FeedTaskProcessor ignores nodeRef values that cannot be used in a NodeRef constructor.



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32321 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2011-11-25 17:28:38 +00:00
parent 44c5efe514
commit 70722a9a3b
3 changed files with 69 additions and 9 deletions

View File

@@ -98,6 +98,16 @@ public class ActivityServiceImplTest extends BaseSpringTest
{
assertTrue(iae.getMessage().contains("activityType is a mandatory parameter"));
}
try
{
this.activityService.postActivity("org.alfresco.testActivityType1", "", "", "{ \"nodeRef\" : \"notfound\" }");
fail("invalid post activity: bad nodeRef");
}
catch (IllegalArgumentException iae)
{
assertTrue(iae.getMessage().contains("Invalid node ref: notfound"));
}
}
public void testGetEmptySiteFeed() throws Exception