use of org.jbpm.casemgmt.api.event.CaseCommentEvent in project jbpm by kiegroup.
the class CommentNotificationEventListenerTest method testBuildParametersMap.
@Test
public void testBuildParametersMap() {
CommentNotificationEventListener listener = new CommentNotificationEventListener();
CommentInstanceImpl comment = new CommentInstanceImpl("john", "simple comment for @owner and @manager", new ArrayList<>());
CaseCommentEvent event = new CaseCommentEvent("john", "CASE-00001", null, comment);
StringBuilder commentContent = new StringBuilder(comment.getComment());
Map<String, Object> parameters = listener.buildParams(event, commentContent);
assertThat(parameters).hasSize(5);
assertThat(parameters).containsEntry(AUTHOR_PARAM, comment.getAuthor()).containsEntry(CASE_ID_PARAM, "CASE-00001").containsEntry(COMMENT_ID_PARAM, comment.getId()).containsEntry(COMMENT_PARAM, commentContent.toString()).containsEntry(CREATED_AT_PARAM, comment.getCreatedAt());
}
Aggregations