60bd7397670196f9e22d62c90690a943e9e28a95
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / AbstractDOMRpcProviderServiceTest.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.junit.Assert.assertEquals;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.MockitoAnnotations.initMocks;
13
14 import java.util.Set;
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 import org.opendaylight.mdsal.dom.api.DOMRpcImplementationRegistration;
20
21 public class AbstractDOMRpcProviderServiceTest extends AbstractDOMRpcProviderService {
22
23     @Mock(name = "domRpcImplementationRegistration")
24     private DOMRpcImplementationRegistration domRpcImplementationRegistration;
25
26     @Test
27     public void registerRpcImplementation() throws Exception {
28         initMocks(this);
29         assertEquals(domRpcImplementationRegistration, this.registerRpcImplementation(
30             mock(DOMRpcImplementation.class)));
31     }
32
33     @Override
34     public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
35             final T implementation, final Set<DOMRpcIdentifier> rpcs) {
36         return domRpcImplementationRegistration;
37     }
38 }