LegacyDOMRpcImplementationAdapter is generic
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / LegacyDOMRpcImplementationAdapterTest.java
index 62bf308523955fa0a82d62e8aa925ed1a49d573b..6bc42bf048af485db42efe17d282fc5e70eeeb88 100644 (file)
@@ -10,26 +10,22 @@ package org.opendaylight.mdsal.binding.dom.adapter;
 import static org.junit.Assert.assertNotNull;
 import static org.mockito.Mockito.mock;
 
-import com.google.common.collect.ImmutableMap;
-import java.lang.reflect.Method;
+import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.mdsal.binding.dom.codec.spi.BindingDOMCodecServices;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.bi.ba.rpcservice.rev140701.OpendaylightTestRpcServiceService;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.common.XMLNamespace;
 
 @Deprecated(since = "11.0.0", forRemoval = true)
-
 public class LegacyDOMRpcImplementationAdapterTest {
     @Test
     public void basicTest() throws Exception {
-        final BindingDOMCodecServices registry = mock(BindingDOMCodecServices.class);
-        final Method testMethod = getClass().getDeclaredMethod("testMethod");
-        final QName rpcType = QName.create(QNameModule.create(XMLNamespace.of("tst")), "test");
-        final LegacyDOMRpcImplementationAdapter adapter = new LegacyDOMRpcImplementationAdapter(
-            new ConstantAdapterContext(registry), OpendaylightTestRpcServiceService.class,
-            ImmutableMap.of(rpcType, testMethod), mock(OpendaylightTestRpcServiceService.class));
+        final var codecServices = mock(BindingDOMCodecServices.class);
+        final var testMethod = getClass().getDeclaredMethod("testMethod");
+        final var rpcType = QName.create("tst", "test");
+        final var adapter = new LegacyDOMRpcImplementationAdapter<>(new ConstantAdapterContext(codecServices),
+            OpendaylightTestRpcServiceService.class, Map.of(rpcType, testMethod),
+            mock(OpendaylightTestRpcServiceService.class));
         assertNotNull(adapter);
     }