Migrate mdsal-dom-spi to JDT annotations
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / ForwardingDOMRpcServiceTest.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.DOMRpcAvailabilityListener;
18 import org.opendaylight.mdsal.dom.api.DOMRpcService;
19 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
20
21 public class ForwardingDOMRpcServiceTest extends ForwardingDOMRpcService {
22
23     @Mock(name = "domRpcService")
24     private DOMRpcService domRpcService;
25
26     @Test
27     public void basicTest() throws Exception {
28         initMocks(this);
29
30         final DOMRpcAvailabilityListener domRpcAvailabilityListener = mock(DOMRpcAvailabilityListener.class);
31
32         doReturn(null).when(domRpcService).invokeRpc(SchemaPath.SAME, null);
33         this.invokeRpc(SchemaPath.SAME, null);
34         verify(domRpcService).invokeRpc(SchemaPath.SAME, null);
35
36         doReturn(null).when(domRpcService).registerRpcListener(domRpcAvailabilityListener);
37         this.registerRpcListener(domRpcAvailabilityListener);
38         verify(domRpcService).registerRpcListener(domRpcAvailabilityListener);
39     }
40
41     @Override
42     protected DOMRpcService delegate() {
43         return domRpcService;
44     }
45 }