### Question:
InformDmaapClient implements JavaDelegate { @Override public void execute(DelegateExecution execution) { String pnfCorrelationId = (String) execution.getVariable(ExecutionVariableNames.PNF_CORRELATION_ID); RuntimeService runtimeService = execution.getProcessEngineServices().getRuntimeService(); dmaapClient.registerForUpdate(pnfCorrelationId, () -> runtimeService.createMessageCorrelation("WorkflowMessage") .processInstanceBusinessKey(execution.getProcessBusinessKey()).correlateWithResult()); }  @Override void execute(DelegateExecution execution); @Autowired void setDmaapClient(DmaapClient dmaapClient);  }### Answer:
@Test public void shouldSendListenerToDmaapClient() { informDmaapClient.execute(delegateExecution); assertThat(dmaapClientTest.getPnfCorrelationId()).isEqualTo("testPnfCorrelationId"); assertThat(dmaapClientTest.getInformConsumer()).isNotNull(); verifyZeroInteractions(messageCorrelationBuilder); }
@Test public void shouldSendListenerToDmaapClientAndSendMessageToCamunda() { informDmaapClient.execute(delegateExecution); dmaapClientTest.getInformConsumer().run(); assertThat(dmaapClientTest.getPnfCorrelationId()).isEqualTo("testPnfCorrelationId"); InOrder inOrder = inOrder(messageCorrelationBuilder); inOrder.verify(messageCorrelationBuilder).processInstanceBusinessKey("testBusinessKey"); inOrder.verify(messageCorrelationBuilder).correlateWithResult(); }