use of com.enonic.xp.issue.CreateIssueCommentParams in project xp by enonic.
the class IssueServiceImplTest_comment method comment_noIssue.
@Test
public void comment_noIssue() throws Exception {
final Instant created = Instant.now().minus(1, ChronoUnit.MINUTES);
final PrincipalKey creator = PrincipalKey.from("user:store:me");
final String creatorDisplayName = "Me Myself";
final CreateIssueCommentParams params = CreateIssueCommentParams.create().text("text").issue(IssueId.create()).creator(creator).creatorDisplayName(creatorDisplayName).created(created).build();
assertThrows(NodeNotFoundException.class, () -> this.issueService.createComment(params));
}
use of com.enonic.xp.issue.CreateIssueCommentParams in project xp by enonic.
the class CreateIssueCommentCommandTest method testNoText.
@Test
public void testNoText() {
final CreateIssueCommentParams params = CreateIssueCommentParams.create().issue(IssueId.create()).build();
final CreateIssueCommentCommand command = createIssueCommentCommand(params);
assertThrows(IllegalArgumentException.class, () -> command.execute());
}
use of com.enonic.xp.issue.CreateIssueCommentParams in project xp by enonic.
the class IssueServiceImplTest_comment method comment_issue.
@Test
public void comment_issue() throws Exception {
Issue issue = this.createIssue(CreateIssueParams.create().title("issue-1"));
final Instant created = Instant.now().minus(1, ChronoUnit.MINUTES);
final PrincipalKey creator = PrincipalKey.from("user:store:me");
final String creatorDisplayName = "Me Myself";
final CreateIssueCommentParams params = CreateIssueCommentParams.create().text("text").issue(issue.getId()).creator(creator).creatorDisplayName(creatorDisplayName).created(created).build();
final IssueComment comment = this.issueService.createComment(params);
assertNotNull(comment);
assertEquals("text", comment.getText());
assertEquals(creator, comment.getCreator());
assertEquals(creatorDisplayName, comment.getCreatorDisplayName());
assertEquals(created, comment.getCreated());
}
Aggregations