Package com.streamreduce.core.model.messages

Examples of com.streamreduce.core.model.messages.MessageComment


        // check if the user added any tags
        MessageUtils.ParsedMessage parsedMessage = MessageUtils.parseMessage(comment);
        Set<String> hashtags = parsedMessage.getTags();

        MessageComment messageComment = new MessageComment(user, parsedMessage.getMessage());

        try {
            SobaMessage sobaMessage = applicationManager.getMessageService().getMessage(user.getAccount(), messageId);
            // this is now a conversation, so add that tag
            hashtags.add("#conversation");
View Full Code Here


                .visibility(SobaObject.Visibility.ACCOUNT)
                .transformedMessage(LOREM_IPSUM)
                .type(MessageType.USER)
                .build();
        sobaMessage.setId(new ObjectId());
        MessageComment messageComment = new MessageComment(testSenderUser, LOREM_IPSUM);

        when(mockUserService.allEnabledUsersForAccount(testAccount)).thenReturn(Lists.newArrayList(testUser));

        testSenderUser.setId(new ObjectId());
View Full Code Here

                .visibility(SobaObject.Visibility.ACCOUNT)
                .transformedMessage(LOREM_IPSUM)
                .type(MessageType.USER)
                .build();
        sobaMessage.setId(new ObjectId());
        MessageComment messageComment = new MessageComment(testSenderUser, LOREM_IPSUM);

        when(mockUserService.allEnabledUsersForAccount(testAccount)).thenReturn(Lists.newArrayList(testUser));

        testUser.getConfig().put(User.ConfigKeys.RECEIVES_COMMENT_NOTIFICATIONS, false);
View Full Code Here

        if (!StringUtils.isBlank(search)) {
            query.and(
                    query.or(
                            query.criteria("senderName").containsIgnoreCase(search),
                            query.criteria("transformedMessage").containsIgnoreCase(search),
                            query.criteria("comments").hasThisElement(new MessageComment(search))
                    )
            );
        }

        //OR filter over hashtag and sender fields
View Full Code Here

        sobaMessage = applicationManager.getMessageService().getMessage(getTestUser().getAccount(),
                userMessage.getMessageId());

        assertEquals(1, sobaMessage.getComments().size());
        MessageComment messageComment =  sobaMessage.getComments().get(0);

        // now remove (nullify) the comment
        makeRequest(url + "/" + messageComment.getCreated(), "DELETE", json, authToken);

        sobaMessage = applicationManager.getMessageService().getMessage(getTestUser().getAccount(),
                userMessage.getMessageId());

        assertEquals(sobaMessage.getComments().get(0).getComment(), "comment removed by @" + testUser.getAlias());
View Full Code Here

        int num = 0;
        SobaMessage sobaMessage = applicationManager.getMessageService().getMessage(getTestUser().getAccount(),
                userMessage.getMessageId());

        sobaMessage.addComment(new MessageComment(getTestUser(), "Some comment from test user"));
        num = sobaMessage.getComments().size();
        applicationManager.getMessageService().updateMessage(getTestUser().getAccount(), sobaMessage);

        String url = getUrl() + "/" + userMessage.getMessageId() + "/comment";
        String response = makeRequest(url, "GET", null, authToken);
View Full Code Here

TOP

Related Classes of com.streamreduce.core.model.messages.MessageComment

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.