StatusUpdateService { public void postStatus(String content, boolean statusPrivate, Collection<String> attachmentIds, String geoLocalization) { createStatus(content, statusPrivate, null, "", "", "", attachmentIds, null, geoLocalization); }  void postStatus(String content, boolean statusPrivate, Collection<String> attachmentIds, String geoLocalization); void postStatus(String content, boolean statusPrivate, Collection<String> attachmentIds); void postStatusToGroup(String content, Group group, Collection<String> attachmentIds, String geoLocalization); void postStatusAsUser(String content, User user); void replyToStatus(String content, String replyTo, Collection<String> attachmentIds); void reportStatus(String reportingLogin, String statusId); Collection<StatusDTO> findReportedStatuses(); void approveReportedStatus(String statusId); void deleteReportedStatus(String statusId);  }
@Test public void shouldPostStatus() throws Exception { String username = "userWhoPostStatus"; mockAuthenticationOnTimelineServiceWithACurrentUser("userWhoPostStatus@ippon.fr"); mockAuthenticationOnStatusUpdateServiceWithACurrentUser("userWhoPostStatus@ippon.fr"); String content = "Longue vie au Ch'ti Jug"; statusUpdateService.postStatus(content, false, new ArrayList<String>(), null); Collection<StatusDTO> statusFromUserline = timelineService.getUserline("userWhoPostStatus", 10, null, null); assertThatNewTestIsPosted(username, content, statusFromUserline); Collection<StatusDTO> statusFromTimeline = timelineService.getTimeline(10, null, null); assertThatNewTestIsPosted(username, content, statusFromTimeline); Collection<StatusDTO> statusFromUserlineOfAFollower = timelineService.getUserline("userWhoReadStatus", 10, null, null); assertThat(statusFromUserlineOfAFollower.isEmpty(), is(true)); }
@Test public void shouldMentionUser() throws Exception { mockAuthenticationOnTimelineServiceWithACurrentUser("other@ippon.fr"); mockAuthenticationOnStatusUpdateServiceWithACurrentUser("other@ippon.fr"); String content = "Hello @jane! @john ! world"; statusUpdateService.postStatus(content, false, new ArrayList<String>(), null); List<String> janeMentions = mentionlineRepository.getMentionline("jane@ippon.fr", 10, null, null); assertThat(janeMentions.size(), is(1)); Status status = (Status) statusRepository.findStatusById(janeMentions.get(0)); assertThat(status.getContent(), is(content)); List<String> johnMentions = mentionlineRepository.getMentionline("john@ippon.fr", 10, null, null); assertThat(johnMentions.size(), is(1)); }