boolean publicGroup = true;
groupService.createGroup(groupName, groupDescription, publicGroup);
Collection<Group> groups = groupService.getGroupsForUser(user);
assertEquals(userGroupSize + 1, groups.size());
Group group = groups.iterator().next();
Collection<StatusDTO> groupStatuses = timelineService.getGroupline(group.getGroupId(), 10, null, null);
assertEquals(0, groupStatuses.size());
for (int i = 0; i < 12; i++) {
String content = "temporary status " + i;
statusUpdateService.postStatusToGroup(content, group, new ArrayList<String>(), "1,2");
}
groupStatuses = timelineService.getGroupline(group.getGroupId(), 10, null, null);
assertEquals(10, groupStatuses.size());
Iterator<StatusDTO> iterator = groupStatuses.iterator();
for (int i = 11; i >= 2; i--) {
StatusDTO temporaryStatus = iterator.next();
assertEquals("temporary status " + i, temporaryStatus.getContent());
timelineService.removeStatus(temporaryStatus.getStatusId());
}
groupStatuses = timelineService.getGroupline(group.getGroupId(), 10, null, null);
assertEquals(2, groupStatuses.size());
// Clean up
groupService.removeMemberFromGroup(user, group);
assertEquals(userGroupSize, groupService.getGroupsForUser(user).size());