Package org.jtalks.jcommune.service.nontransactional

Examples of org.jtalks.jcommune.service.nontransactional.MentionedUsers


    /**
     * {@inheritDoc}
     */
    @Override
    public String processUserBbCodesInPost(String postContent) {
        MentionedUsers mentionedUsers = MentionedUsers.parse(postContent);
        return mentionedUsers.getTextWithProcessedUserTags(getDao());
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    @Override
    public void notifyAndMarkNewlyMentionedUsers(Post post) {
        MentionedUsers mentionedUsers = MentionedUsers.parse(post);
        List<JCUser> usersToNotify = mentionedUsers.getNewUsersToNotify(getDao());

        for (JCUser user : usersToNotify) {
            mailService.sendUserMentionedNotification(user, post.getId());
        }

        mentionedUsers.markUsersAsAlreadyNotified(postDao);
    }
View Full Code Here

        String secondMentionedUserName = "jk1";
        when(userDao.getByUsername(firstMentionedUserName)).thenReturn(null);
        when(userDao.getByUsername(secondMentionedUserName)).thenReturn(null);
        String notProcessedSource = format(MENTIONING_TEMPLATE, firstMentionedUserName, secondMentionedUserName);

        MentionedUsers mentionedUsers = mock(MentionedUsers.class);
        when(mentionedUsers.extractAllMentionedUsers(notProcessedSource))
                .thenReturn(asSet(firstMentionedUserName, secondMentionedUserName));

        String actualAfterProcess = userService.processUserBbCodesInPost(notProcessedSource);

        String msgWithNotFoundUsers = format(MENTIONING_MESSAGE_WHEN_USER_NOT_FOUND, firstMentionedUserName,
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.service.nontransactional.MentionedUsers

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.