AsyncCaseInstanceAuditEventProducer implements CaseEventListener, Cacheable { @Override public void afterCaseDataAdded(CaseDataEvent event) { List<CaseFileData> logs = updateCaseFileItems(event, event.getData(), event.getCaseId(), event.getDefinitionId(), event.getUser()); if (logs != null && !logs.isEmpty()) { sendMessage(AFTER_CASE_DATA_ADDED_EVENT_TYPE, new AuditCaseInstanceData(event.getCaseId(), logs, null), 4); } } AsyncCaseInstanceAuditEventProducer(); ConnectionFactory getConnectionFactory(); void setConnectionFactory(ConnectionFactory connectionFactory); Queue getQueue(); void setQueue(Queue queue); boolean isTransacted(); void setTransacted(boolean transacted); @Override void afterCaseStarted(CaseStartEvent event); @Override void afterCaseReopen(CaseReopenEvent event); @Override void afterCaseRoleAssignmentAdded(CaseRoleAssignmentEvent event); @Override void afterCaseRoleAssignmentRemoved(CaseRoleAssignmentEvent event); @Override void afterCaseDataAdded(CaseDataEvent event); @Override void afterCaseDataRemoved(CaseDataEvent event); @Override void close();  }
@Test public void testCaseDataAdded() throws JMSException { Map<String, Object> data = new HashMap<>(); data.put("test", "value"); CaseFileInstanceImpl caseFile = new CaseFileInstanceImpl("TEST-01", "case"); CaseDataEvent event = new CaseDataEvent("user", "TEST-01", caseFile, "case", data); logProducer.afterCaseDataAdded(event); verify(message, times(1)).setStringProperty(eq("LogType"), eq("Case")); verify(message, times(1)).setIntProperty(eq("EventType"), eq(AFTER_CASE_DATA_ADDED_EVENT_TYPE)); verify(producer, times(1)).setPriority(eq(4)); verify(producer, times(1)).send(eq(message)); }