2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.dom.spi;
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;
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;
21 public class ForwardingDOMRpcServiceTest extends ForwardingDOMRpcService {
23 @Mock(name = "domRpcService")
24 private DOMRpcService domRpcService;
27 public void basicTest() throws Exception {
30 final DOMRpcAvailabilityListener domRpcAvailabilityListener = mock(DOMRpcAvailabilityListener.class);
32 doReturn(null).when(domRpcService).invokeRpc(SchemaPath.SAME, null);
33 this.invokeRpc(SchemaPath.SAME, null);
34 verify(domRpcService).invokeRpc(SchemaPath.SAME, null);
36 doReturn(null).when(domRpcService).registerRpcListener(domRpcAvailabilityListener);
37 this.registerRpcListener(domRpcAvailabilityListener);
38 verify(domRpcService).registerRpcListener(domRpcAvailabilityListener);
42 protected DOMRpcService delegate() {