@Override public CoreEvent process(CoreEvent event) throws MuleException { eventContextService.getCurrentlyActiveFlowStacks().stream() .filter(fsde -> fsde.getEventId().equals(event.getContext().getId())).findAny() .ifPresent(dumpEntry -> stackToAssert = dumpEntry.getFlowCallStack()); return event; }
@Override protected void doTearDown() throws Exception { if (_testEvent != null) { ((BaseEventContext) _testEvent.getContext()).success(); } super.doTearDown(); if (eventContextService != null && DefaultMuleConfiguration.isFlowTrace()) { new PollingProber(1000, 10).check(new JUnitLambdaProbe(() -> { assertThat(eventContextService.getCurrentlyActiveFlowStacks(), is(empty())); return true; })); } } }