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 java.util.Collections;
16 import javax.annotation.Nonnull;
17 import org.junit.Test;
18 import org.mockito.Mock;
19 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
20 import org.opendaylight.mdsal.dom.api.DOMRpcProviderService;
22 public class ForwardingDOMRpcProviderServiceTest extends ForwardingDOMRpcProviderService {
24 @Mock(name = "domRpcProviderService")
25 private DOMRpcProviderService domRpcProviderService;
28 public void basicTest() throws Exception {
31 final DOMRpcImplementation domRpcImplementation = mock(DOMRpcImplementation.class);
33 doReturn(null).when(domRpcProviderService).registerRpcImplementation(domRpcImplementation);
34 this.registerRpcImplementation(domRpcImplementation);
35 verify(domRpcProviderService).registerRpcImplementation(domRpcImplementation);
37 doReturn(null).when(domRpcProviderService).registerRpcImplementation(domRpcImplementation,
38 Collections.EMPTY_SET);
39 this.registerRpcImplementation(domRpcImplementation, Collections.EMPTY_SET);
40 verify(domRpcProviderService).registerRpcImplementation(domRpcImplementation, Collections.EMPTY_SET);
45 protected DOMRpcProviderService delegate() {
46 return domRpcProviderService;