Bug 509: Fixed incorrect merging of Data Store Writes / Events
[controller.git] / opendaylight / config / threadpool-config-impl / src / test / java / org / opendaylight / controller / config / threadpool / eventbus / TestingEventBusModule.java
1 /*\r
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.controller.config.threadpool.eventbus;\r
9 \r
10 import static org.mockito.Mockito.doNothing;\r
11 import static org.mockito.Mockito.mock;\r
12 \r
13 import org.opendaylight.controller.config.api.DynamicMBeanWithInstance;\r
14 import org.opendaylight.controller.config.api.ModuleIdentifier;\r
15 import org.opendaylight.controller.config.manager.impl.AbstractMockedModule;\r
16 import org.opendaylight.controller.config.spi.Module;\r
17 import org.opendaylight.controller.config.threadpool.util.CloseableEventBus;\r
18 import org.opendaylight.controller.config.yang.threadpool.EventBusServiceInterface;\r
19 import org.opendaylight.controller.config.yang.threadpool.impl.EventBusModuleMXBean;\r
20 \r
21 public class TestingEventBusModule extends AbstractMockedModule implements Module, EventBusServiceInterface,\r
22         EventBusModuleMXBean {\r
23 \r
24     public TestingEventBusModule(DynamicMBeanWithInstance old, ModuleIdentifier id) {\r
25         super(old, id);\r
26     }\r
27 \r
28     @Override\r
29     protected AutoCloseable prepareMockedInstance() throws Exception {\r
30         CloseableEventBus bus = mock(CloseableEventBus.class);\r
31         doNothing().when(bus).close();\r
32         return bus;\r
33     }\r
34 \r
35 }\r