Skip to content

Commit f272c8a

Browse files
committed
Properly swap the command invoker for EnableVerboseExecutionTreeLogging.class
1 parent ff1dd08 commit f272c8a

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

modules/flowable-engine/src/main/java/org/flowable/engine/impl/test/PluggableFlowableExtension.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ public class PluggableFlowableExtension extends InternalFlowableExtension {
4343

4444
private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace.create(PluggableFlowableExtension.class);
4545

46+
@Override
47+
public void beforeEach(ExtensionContext context) {
48+
super.beforeEach(context);
49+
if (AnnotationSupport.isAnnotated(context.getRequiredTestClass(), EnableVerboseExecutionTreeLogging.class)) {
50+
swapCommandInvoker(getProcessEngine(context), true);
51+
}
52+
}
53+
4654
@Override
4755
public void afterEach(ExtensionContext context) throws Exception {
4856
try {
@@ -57,14 +65,7 @@ public void afterEach(ExtensionContext context) throws Exception {
5765
@Override
5866
protected ProcessEngine getProcessEngine(ExtensionContext context) {
5967
String configurationResource = getConfigurationResource(context);
60-
ProcessEngine processEngine = getStore(context).getOrComputeIfAbsent(configurationResource, this::initializeProcessEngine, ProcessEngine.class);
61-
62-
// Enable verbose execution tree debugging if needed
63-
Class<?> testClass = context.getRequiredTestClass();
64-
if (AnnotationSupport.isAnnotated(testClass, EnableVerboseExecutionTreeLogging.class)) {
65-
swapCommandInvoker(processEngine, true);
66-
}
67-
return processEngine;
68+
return getStore(context).getOrComputeIfAbsent(configurationResource, this::initializeProcessEngine, ProcessEngine.class);
6869
}
6970

7071
protected ProcessEngine initializeProcessEngine(String configurationResource) {

0 commit comments

Comments
 (0)