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.binding.dom.adapter;
10 import static org.junit.Assert.assertNotNull;
11 import static org.mockito.Mockito.mock;
13 import com.google.common.collect.ImmutableMap;
14 import java.lang.reflect.Method;
15 import org.junit.Test;
16 import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.bi.ba.rpcservice.rev140701.OpendaylightTestRpcServiceService;
18 import org.opendaylight.yangtools.yang.common.QName;
19 import org.opendaylight.yangtools.yang.common.QNameModule;
20 import org.opendaylight.yangtools.yang.common.XMLNamespace;
22 public class BindingDOMRpcImplementationAdapterTest {
25 public void basicTest() throws Exception {
26 final BindingDOMCodecServices registry = mock(BindingDOMCodecServices.class);
27 final Method testMethod = this.getClass().getDeclaredMethod("testMethod");
28 final QName rpcType = QName.create(QNameModule.create(XMLNamespace.of("tst")), "test");
29 final BindingDOMRpcImplementationAdapter adapter = new BindingDOMRpcImplementationAdapter(
30 new ConstantAdapterContext(registry), OpendaylightTestRpcServiceService.class,
31 ImmutableMap.of(rpcType, testMethod), mock(OpendaylightTestRpcServiceService.class));
32 assertNotNull(adapter);
35 private void testMethod() {