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.yangtools.yang.binding.util;
10 import static org.junit.Assert.assertNotNull;
11 import static org.junit.Assert.fail;
12 import static org.mockito.Mockito.mock;
14 import com.google.common.collect.ImmutableMap;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.binding.RpcService;
17 import org.opendaylight.yangtools.yang.common.QName;
19 public class QNameRpcServiceInvokerTest {
22 public void instanceForTest() throws Exception {
23 assertNotNull(QNameRpcServiceInvoker.instanceFor(ImmutableMap.of()));
26 @Test(expected = IllegalArgumentException.class)
27 public void qnameToKeyTest() throws Exception {
28 final RpcService rpcService = mock(RpcService.class);
29 QNameRpcServiceInvoker.instanceFor(ImmutableMap.of()).invokeRpc(rpcService, QName.create("test"), null);
30 fail("Expected exception: constructed with empty map");