Added threadpool config tests.
[controller.git] / opendaylight / config / threadpool-config-impl / src / test / java / org / opendaylight / controller / config / threadpool / eventbus / TestingEventBusModule.java
diff --git a/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java
new file mode 100644 (file)
index 0000000..ee6bbc5
--- /dev/null
@@ -0,0 +1,28 @@
+package org.opendaylight.controller.config.threadpool.eventbus;\r
+\r
+import static org.mockito.Mockito.doNothing;\r
+import static org.mockito.Mockito.mock;\r
+\r
+import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;\r
+import org.opendaylight.controller.config.api.ModuleIdentifier;\r
+import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;\r
+import org.opendaylight.controller.config.spi.Module;\r
+import org.opendaylight.controller.config.threadpool.util.CloseableEventBus;\r
+import org.opendaylight.controller.config.yang.threadpool.EventBusServiceInterface;\r
+import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleMXBean;\r
+\r
+public class TestingEventBusModule extends AbstractMockedModule implements Module, EventBusServiceInterface,\r
+        EventBusModuleMXBean {\r
+\r
+    public TestingEventBusModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {\r
+        super(old, id);\r
+    }\r
+\r
+    @Override\r
+    protected AutoCloseable prepareMockedInstance() throws Exception {\r
+        CloseableEventBus bus = mock(CloseableEventBus.class);\r
+        doNothing().when(bus).close();\r
+        return bus;\r
+    }\r
+\r
+}\r