Correct ActionService generics
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / BindingDOMRpcIntegrationTest.java
index 1b0206d302c1a5dc4e514bd12c23838c9217f64b..f56b299a3fbc6ada335c13b6d1d9dc29a9bff89d 100644 (file)
@@ -50,14 +50,12 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 public class BindingDOMRpcIntegrationTest {
     private static final InstanceIdentifier<TopLevelList> BA_NODE_ID = InstanceIdentifier.create(Top.class)
             .child(TopLevelList.class, new TopLevelListKey("a"));
 
     private static final QName KNOCK_KNOCK_QNAME = QName.create(KnockKnockOutput.QNAME, "knock-knock");
-    private static final SchemaPath KNOCK_KNOCK_PATH = SchemaPath.create(true, KNOCK_KNOCK_QNAME);
 
     private RpcProviderService baRpcProviderService;
     private RpcConsumerRegistry baRpcConsumerService;
@@ -94,7 +92,7 @@ public class BindingDOMRpcIntegrationTest {
         KnockKnockInput baKnockKnockInput = knockKnock(BA_NODE_ID).setQuestion("who's there?").build();
 
         ContainerNode biKnockKnockInput = toDOMKnockKnockInput(baKnockKnockInput);
-        DOMRpcResult domResult = biRpcService.invokeRpc(KNOCK_KNOCK_PATH, biKnockKnockInput).get(5, TimeUnit.SECONDS);
+        DOMRpcResult domResult = biRpcService.invokeRpc(KNOCK_KNOCK_QNAME, biKnockKnockInput).get(5, TimeUnit.SECONDS);
         assertNotNull(domResult);
         assertNotNull(domResult.getResult());
         assertTrue("Binding KnockKnock service was not invoked",
@@ -109,8 +107,9 @@ public class BindingDOMRpcIntegrationTest {
 
         biRpcProviderService.registerRpcImplementation((rpc, input) ->
             FluentFutures.immediateFluentFuture(new DefaultDOMRpcResult(testContext.getCodec()
-                    .getCodecFactory().toNormalizedNodeRpcData(baKnockKnockOutput))),
-            DOMRpcIdentifier.create(KNOCK_KNOCK_PATH, testContext.getCodec().toNormalized(BA_NODE_ID)));
+                    .currentSerializer().toNormalizedNodeRpcData(baKnockKnockOutput))),
+            DOMRpcIdentifier.create(KNOCK_KNOCK_QNAME, testContext.getCodec().currentSerializer()
+                .toYangInstanceIdentifier(BA_NODE_ID)));
 
         final OpendaylightKnockKnockRpcService baKnockService =
                 baRpcConsumerService.getRpcService(OpendaylightKnockKnockRpcService.class);
@@ -153,7 +152,7 @@ public class BindingDOMRpcIntegrationTest {
     }
 
     private ContainerNode toDOMKnockKnockInput(final KnockKnockInput from) {
-        return testContext.getCodec().getCodecFactory().toNormalizedNodeRpcData(from);
+        return testContext.getCodec().currentSerializer().toNormalizedNodeRpcData(from);
     }
 
     private static class OpendaylightKnockKnockRpcServiceImpl implements OpendaylightKnockKnockRpcService {
@@ -172,7 +171,7 @@ public class BindingDOMRpcIntegrationTest {
         }
 
         OpendaylightKnockKnockRpcServiceImpl registerTo(final RpcProviderService registry,
-                InstanceIdentifier<?>... paths) {
+                final InstanceIdentifier<?>... paths) {
             registration = registry.registerRpcImplementation(OpendaylightKnockKnockRpcService.class, this,
                     ImmutableSet.copyOf(paths));
             assertNotNull(registration);
@@ -180,7 +179,7 @@ public class BindingDOMRpcIntegrationTest {
         }
 
         @Override
-        public ListenableFuture<RpcResult<KnockKnockOutput>> knockKnock(KnockKnockInput input) {
+        public ListenableFuture<RpcResult<KnockKnockOutput>> knockKnock(final KnockKnockInput input) {
             receivedKnocks.put(input.getKnockerId(), input);
             return knockKnockResult;
         }