From 4b9a869d50fc1d036dc6c1103db5b9f2d5787692 Mon Sep 17 00:00:00 2001 From: Harjit Singh Date: Mon, 29 Jun 2020 08:45:50 -0700 Subject: [PATCH] Provide a default constructor for plugin, fixes #103 --- .../reactor/plugin/ReactorProcessEnginePlugin.java | 9 +++++++++ .../reactor/plugin/ReactorProcessEnginePluginTest.java | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/extension/core/src/main/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePlugin.java b/extension/core/src/main/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePlugin.java index f674c50..ea38fc4 100644 --- a/extension/core/src/main/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePlugin.java +++ b/extension/core/src/main/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePlugin.java @@ -19,6 +19,15 @@ public class ReactorProcessEnginePlugin extends AbstractProcessEnginePlugin { private boolean reactorListenerFirstOnUserTask = false; + /** + * Default constructor for bean initialization. Uses new CamundaEventBus(). + * + * @see #ReactorProcessEnginePlugin(CamundaEventBus) + */ + public ReactorProcessEnginePlugin() { + this(new CamundaEventBus()); + } + public ReactorProcessEnginePlugin(final CamundaEventBus eventBus) { this.eventBus = eventBus; } diff --git a/extension/core/src/test/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePluginTest.java b/extension/core/src/test/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePluginTest.java index 8299395..df59bfa 100644 --- a/extension/core/src/test/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePluginTest.java +++ b/extension/core/src/test/java/org/camunda/bpm/extension/reactor/plugin/ReactorProcessEnginePluginTest.java @@ -103,4 +103,11 @@ public void notify(DelegateTask delegateTask) { verify(task).addCandidateGroup("bar"); verify(task).setName("my task"); } + + @Test + public void provides_default_constructor() throws Exception { + ReactorProcessEnginePlugin plugin = new ReactorProcessEnginePlugin(); + + assertThat(plugin.getEventBus()).isNotNull(); + } }