use of com.enonic.xp.issue.DeleteIssueCommentParams in project xp by enonic.
the class DeleteIssueCommentCommandTest method testNoCommentId.
@Test
public void testNoCommentId() {
final DeleteIssueCommentParams params = DeleteIssueCommentParams.create().build();
final DeleteIssueCommentCommand command = createDeleteIssueCommentCommand(params);
assertThrows(IllegalArgumentException.class, () -> command.execute());
}
use of com.enonic.xp.issue.DeleteIssueCommentParams in project xp by enonic.
the class DeleteIssueCommentCommandTest method delete.
@Test
public void delete() {
DeleteIssueCommentParams params = DeleteIssueCommentParams.create().comment(NodeId.from(UUID.randomUUID())).build();
final NodeIds nodeIds = NodeIds.from(params.getComment());
final DeleteIssueCommentCommand command = createDeleteIssueCommentCommand(params);
Mockito.when(this.nodeService.deleteById(Mockito.any(NodeId.class))).thenReturn(nodeIds);
final DeleteIssueCommentResult result = command.execute();
assertNotNull(result);
assertEquals(1, result.getIds().getSize());
assertEquals(params.getComment(), result.getIds().first());
}
use of com.enonic.xp.issue.DeleteIssueCommentParams in project xp by enonic.
the class IssueServiceImplTest_deleteComment method comments_deleteNotExisting.
@Test
public void comments_deleteNotExisting() throws Exception {
DeleteIssueCommentParams params = DeleteIssueCommentParams.create().comment(NodeId.from(UUID.randomUUID())).build();
final DeleteIssueCommentResult result = this.issueService.deleteComment(params);
assertNotNull(result);
assertEquals(0, result.getIds().getSize());
}
use of com.enonic.xp.issue.DeleteIssueCommentParams in project xp by enonic.
the class IssueServiceImplTest_deleteComment method comments_delete.
@Test
public void comments_delete() throws Exception {
DeleteIssueCommentParams params = DeleteIssueCommentParams.create().comment(this.comment.getId()).build();
final DeleteIssueCommentResult result = this.issueService.deleteComment(params);
assertNotNull(result);
assertEquals(1, result.getIds().getSize());
}
Aggregations