1 package org.opendaylight.controller.config.threadpool.fixed;
\r
3 import static org.mockito.Mockito.doNothing;
\r
4 import static org.mockito.Mockito.doReturn;
\r
5 import static org.mockito.Mockito.mock;
\r
7 import java.util.concurrent.ExecutorService;
\r
9 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;
\r
10 import org.opendaylight.controller.config.api.ModuleIdentifier;
\r
11 import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;
\r
12 import org.opendaylight.controller.config.spi.Module;
\r
13 import org.opendaylight.controller.config.threadpool.util.FixedThreadPoolWrapper;
\r
14 import org.opendaylight.controller.config.yang.threadpool.ThreadPoolServiceInterface;
\r
16 public class TestingFixedThreadPoolModule extends AbstractMockedModule implements ThreadPoolServiceInterface, Module {
\r
18 public TestingFixedThreadPoolModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {
\r
23 protected AutoCloseable prepareMockedInstance() throws Exception {
\r
24 FixedThreadPoolWrapper pool = mock(FixedThreadPoolWrapper.class);
\r
25 doNothing().when(pool).close();
\r
26 doReturn(mock(ExecutorService.class)).when(pool).getExecutor();
\r