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.mockito.Mockito.doNothing;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.verify;
14 import org.junit.Test;
15 import org.opendaylight.mdsal.dom.api.DOMRpcImplementationRegistration;
16 import org.opendaylight.yangtools.yang.binding.RpcService;
18 public class BindingRpcAdapterRegistrationTest {
20 public void removeRegistrationTest() throws Exception {
21 final RpcService rpcService = mock(RpcService.class);
22 final DOMRpcImplementationRegistration<?> domRpcImplementationRegistration =
23 mock(DOMRpcImplementationRegistration.class);
24 final BindingRpcAdapterRegistration<?> bindingRpcAdapterRegistration =
25 new BindingRpcAdapterRegistration<>(rpcService, domRpcImplementationRegistration);
26 doNothing().when(domRpcImplementationRegistration).close();
27 bindingRpcAdapterRegistration.close();
28 verify(domRpcImplementationRegistration).close();