TimelineService { public Collection<StatusDTO> getTagline(String tag, int nbStatus, String start, String finish) { if (tag == null || tag.isEmpty()) { tag = hashtagDefault; } User currentUser = authenticationService.getCurrentUser(); String domain = DomainUtil.getDomainFromLogin(currentUser.getLogin()); List<String> statuses = taglineRepository.getTagline(domain, tag, nbStatus, start, finish); Collection<StatusDTO> dtos = buildStatusList(statuses); if (statuses.size() != dtos.size()) { Collection<String> statusIdsToDelete = findStatusesToCleanUp(statuses, dtos); taglineRepository.removeStatusesFromTagline(tag, domain, statusIdsToDelete); return getTagline(tag, nbStatus, start, finish); } dtos = filterStatusFromBlockedUsers(dtos); return dtos; }  StatusDTO getStatus(String statusId); StatusDetails getStatusDetails(String statusId); Collection<StatusDTO> buildStatusList(List<String> line); Collection<StatusDTO> getMentionline(int nbStatus, String start, String finish); Collection<StatusDTO> getTagline(String tag, int nbStatus, String start, String finish); Collection<StatusDTO> getGroupline(String groupId, Integer nbStatus, String start, String finish); Collection<StatusDTO> getTimeline(int nbStatus, String start, String finish); Collection<StatusDTO> getUserTimeline(String login, int nbStatus, String start, String finish); Collection<StatusDTO> getDomainline(int nbStatus, String start, String finish); Collection<StatusDTO> getUserline(String username, int nbStatus, String start, String finish); void removeStatus(String statusId); void shareStatus(String statusId); void addFavoriteStatus(String statusId); void removeFavoriteStatus(String statusId); void announceStatus(String statusId); Collection<StatusDTO> getFavoritesline(); void hideStatus(String statusId);  }
@Test public void shouldGetTagline() throws Exception { String login = "userWithStatus@ippon.fr"; String username = "userWithStatus"; mockAuthenticationOnTimelineServiceWithACurrentUser(login); String hashtag = "ippon"; Collection<StatusDTO> status = timelineService.getTagline(hashtag, 10, null, null); assertThatLineForUserWithStatusIsOk(username, status); }