public void testWithStreamIdSharedInActivity()
{
final long activityId = 6789L;
final long activityId2 = 6790L;
final StreamScope scope = new StreamScope(ScopeType.RESOURCE, "http://foo.foo.foo.com");
getEntityManager().persist(scope);
getEntityManager().flush();
// an activity that shares the shared resource
SharedResource sr = new SharedResource("http://foo.foo.foo.com");
sr.setStreamScope(scope);
getEntityManager().persist(sr);
getEntityManager().flush();
scope.setDestinationEntityId(sr.getId());
getEntityManager().flush();
Activity act = getEntityManager().find(Activity.class, activityId);
act.setSharedLink(sr);
getEntityManager().flush();
// an activity that came from the shared resource
act = getEntityManager().find(Activity.class, activityId2);
act.setRecipientStreamScope(scope);
getEntityManager().flush();
final List<Long> request = new ArrayList<Long>();
request.add(scope.getId());
List<List<Long>> activityIds = sut.execute(request);
assertEquals(1, activityIds.size());
// assertEquals(2, activityIds.get(0).size());
assertTrue(activityIds.get(0).contains(activityId));