Convert mdsal-dom-spi to a JPMS module
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / ForwardingDOMRpcImplementationTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.dom.spi;
9
10 import static org.mockito.Mockito.doReturn;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.verify;
13
14 import org.junit.Test;
15 import org.junit.runner.RunWith;
16 import org.mockito.Mock;
17 import org.mockito.junit.MockitoJUnitRunner;
18 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
19 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
20
21 @RunWith(MockitoJUnitRunner.StrictStubs.class)
22 public class ForwardingDOMRpcImplementationTest extends ForwardingDOMRpcImplementation {
23     @Mock(name = "domRpcImplementation")
24     public DOMRpcImplementation domRpcImplementation;
25
26     @Test
27     public void basicTest() throws Exception {
28         final DOMRpcIdentifier domRpcIdentifier = mock(DOMRpcIdentifier.class);
29
30         doReturn(null).when(domRpcImplementation).invokeRpc(domRpcIdentifier, null);
31         this.invokeRpc(domRpcIdentifier, null);
32         verify(domRpcImplementation).invokeRpc(domRpcIdentifier, null);
33     }
34
35     @Override
36     protected DOMRpcImplementation delegate() {
37         return domRpcImplementation;
38     }
39 }