2781d22be7e2e7a80938747577f6b1634201788c
[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 import static org.mockito.MockitoAnnotations.initMocks;
14
15 import org.junit.Test;
16 import org.mockito.Mock;
17 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
18 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
19
20 public class ForwardingDOMRpcImplementationTest extends ForwardingDOMRpcImplementation {
21
22     @Mock(name = "domRpcImplementation")
23     private DOMRpcImplementation domRpcImplementation;
24
25     @Test
26     public void basicTest() throws Exception {
27         initMocks(this);
28
29         final DOMRpcIdentifier domRpcIdentifier = mock(DOMRpcIdentifier.class);
30
31         doReturn(null).when(domRpcImplementation).invokeRpc(domRpcIdentifier, null);
32         this.invokeRpc(domRpcIdentifier, null);
33         verify(domRpcImplementation).invokeRpc(domRpcIdentifier, null);
34     }
35
36     @Override
37     protected DOMRpcImplementation delegate() {
38         return domRpcImplementation;
39     }
40 }