package com.atlassian.stash.internal.notification.pull.activity;

import com.atlassian.bitbucket.comment.Comment;
import com.google.common.collect.ImmutableList;

import java.util.Date;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

abstract class AbstractCommentThreadTest {

    protected static final ImmutableList<Comment> comments = ImmutableList.of(
            mockComment(1L, "One"),
            mockComment(2L, "Two"),
            mockComment(3L, "Three"),
            mockComment(4L, "Four")
    );

    private static Comment mockComment(Long id, String text) {
        Comment commentMock = mock(Comment.class, text);
        when(commentMock.getId()).thenReturn(id);
        when(commentMock.getText()).thenReturn(text);
        when(commentMock.getCreatedDate()).thenReturn(new Date());
        return commentMock;
    }

}
