@Test public void testGetFollowersWithGroupDestinationStream() { ActivityDTO testActivity = new ActivityDTO(); testActivity.setId(1L); StreamEntityDTO testDestinationStream = new StreamEntityDTO(); testDestinationStream.setId(1L); testDestinationStream.setUniqueIdentifier("group1"); testDestinationStream.setType(EntityType.GROUP); testActivity.setDestinationStream(testDestinationStream); DomainGroupModelView testGroupModelView = new DomainGroupModelView(); testGroupModelView.setEntityId(5L); final List<DomainGroupModelView> testGroupModelViewList = new ArrayList<DomainGroupModelView>(); testGroupModelViewList.add(testGroupModelView); List<Long> results = sut.execute(testActivity); Assert.assertEquals(0, results.size()); context.assertIsSatisfied(); }
public List<Long> execute(final ActivityDTO activity) { StreamEntityDTO destinationStream = activity.getDestinationStream(); List<Long> followers = null; if (destinationStream.getType() == EntityType.PERSON) { long personId = getPersonIdFromAccountIdMapper.execute(destinationStream.getUniqueIdentifier()); followers = personFollowersMapper.execute(personId); } else if (destinationStream.getType() == EntityType.GROUP) { followers = new ArrayList<Long>(); } else { throw new IllegalArgumentException("This mapper does not support the destination stream type supplied."); } return followers; }
GetPersonIdsFollowingActivityDestinationStreamMapper implements DomainMapper<ActivityDTO, List<Long>> { public List<Long> execute(final ActivityDTO activity) { StreamEntityDTO destinationStream = activity.getDestinationStream(); List<Long> followers = null; if (destinationStream.getType() == EntityType.PERSON) { long personId = getPersonIdFromAccountIdMapper.execute(destinationStream.getUniqueIdentifier()); followers = personFollowersMapper.execute(personId); } else if (destinationStream.getType() == EntityType.GROUP) { followers = new ArrayList<Long>(); } else { throw new IllegalArgumentException("This mapper does not support the destination stream type supplied."); } return followers; } }
GetPersonIdsFollowingActivityDestinationStreamMapper implements DomainMapper<ActivityDTO, List<Long>> { public List<Long> execute(final ActivityDTO activity) { StreamEntityDTO destinationStream = activity.getDestinationStream(); List<Long> followers = null; if (destinationStream.getType() == EntityType.PERSON) { long personId = getPersonIdFromAccountIdMapper.execute(destinationStream.getUniqueIdentifier()); followers = personFollowersMapper.execute(personId); } else if (destinationStream.getType() == EntityType.GROUP) { followers = new ArrayList<Long>(); } else { throw new IllegalArgumentException("This mapper does not support the destination stream type supplied."); } return followers; } GetPersonIdsFollowingActivityDestinationStreamMapper(
            final DomainMapper<Long, List<Long>> inPersonFollowersMapper,
            final DomainMapper<String, Long> inGetPersonIdFromAccountIdMapper); }
GetPersonIdsFollowingActivityDestinationStreamMapper implements DomainMapper<ActivityDTO, List<Long>> { public List<Long> execute(final ActivityDTO activity) { StreamEntityDTO destinationStream = activity.getDestinationStream(); List<Long> followers = null; if (destinationStream.getType() == EntityType.PERSON) { long personId = getPersonIdFromAccountIdMapper.execute(destinationStream.getUniqueIdentifier()); followers = personFollowersMapper.execute(personId); } else if (destinationStream.getType() == EntityType.GROUP) { followers = new ArrayList<Long>(); } else { throw new IllegalArgumentException("This mapper does not support the destination stream type supplied."); } return followers; } GetPersonIdsFollowingActivityDestinationStreamMapper(
            final DomainMapper<Long, List<Long>> inPersonFollowersMapper,
            final DomainMapper<String, Long> inGetPersonIdFromAccountIdMapper); List<Long> execute(final ActivityDTO activity); }
GetPersonIdsFollowingActivityDestinationStreamMapper implements DomainMapper<ActivityDTO, List<Long>> { public List<Long> execute(final ActivityDTO activity) { StreamEntityDTO destinationStream = activity.getDestinationStream(); List<Long> followers = null; if (destinationStream.getType() == EntityType.PERSON) { long personId = getPersonIdFromAccountIdMapper.execute(destinationStream.getUniqueIdentifier()); followers = personFollowersMapper.execute(personId); } else if (destinationStream.getType() == EntityType.GROUP) { followers = new ArrayList<Long>(); } else { throw new IllegalArgumentException("This mapper does not support the destination stream type supplied."); } return followers; } GetPersonIdsFollowingActivityDestinationStreamMapper(
            final DomainMapper<Long, List<Long>> inPersonFollowersMapper,
            final DomainMapper<String, Long> inGetPersonIdFromAccountIdMapper); List<Long> execute(final ActivityDTO activity);  }