use of com.enonic.xp.issue.DeleteIssueCommentResult 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.DeleteIssueCommentResult 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.DeleteIssueCommentResult in project xp by enonic.
the class DeleteIssueCommentCommand method doExecute.
private DeleteIssueCommentResult doExecute() {
validateBlockingChecks();
NodeIds deletedIds = nodeService.deleteById(params.getComment());
nodeService.refresh(RefreshMode.SEARCH);
return new DeleteIssueCommentResult(deletedIds);
}
use of com.enonic.xp.issue.DeleteIssueCommentResult 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