X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconfig%2Fthreadpool-config-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fthreadpool%2Feventbus%2FTestingEventBusModule.java;fp=opendaylight%2Fconfig%2Fthreadpool-config-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fthreadpool%2Feventbus%2FTestingEventBusModule.java;h=ee6bbc51bc49d1e1e761032f6adf3a14b3bbb4b4;hb=17c744900d71af042b05118a0d7abdc097c057e5;hp=0000000000000000000000000000000000000000;hpb=353b76bddbe7a939a4a8ed54a3b794e6866660d7;p=controller.git 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 index 0000000000..ee6bbc51bc --- /dev/null +++ b/opendaylight/config/threadpool-config-impl/src/test/java/org/opendaylight/controller/config/threadpool/eventbus/TestingEventBusModule.java @@ -0,0 +1,28 @@ +package org.opendaylight.controller.config.threadpool.eventbus; + +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; + +import org.opendaylight.controller.config.api.DynamicMBeanWithInstance; +import org.opendaylight.controller.config.api.ModuleIdentifier; +import org.opendaylight.controller.config.manager.impl.AbstractMockedModule; +import org.opendaylight.controller.config.spi.Module; +import org.opendaylight.controller.config.threadpool.util.CloseableEventBus; +import org.opendaylight.controller.config.yang.threadpool.EventBusServiceInterface; +import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleMXBean; + +public class TestingEventBusModule extends AbstractMockedModule implements Module, EventBusServiceInterface, + EventBusModuleMXBean { + + public TestingEventBusModule(DynamicMBeanWithInstance old, ModuleIdentifier id) { + super(old, id); + } + + @Override + protected AutoCloseable prepareMockedInstance() throws Exception { + CloseableEventBus bus = mock(CloseableEventBus.class); + doNothing().when(bus).close(); + return bus; + } + +}