ONOS-7007 dealing with root relative path

- workarounds to deal with root relative ResourceId used by DynamicConfigEvent
- fix issue, where duplicate KeyLeaf was getting added

Change-Id: I957044f8da3d71e064663011c8bd8fceeb1cf44e
diff --git a/apps/configsync/src/test/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizerTest.java b/apps/configsync/src/test/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizerTest.java
index 78812fb..bfdead6 100644
--- a/apps/configsync/src/test/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizerTest.java
+++ b/apps/configsync/src/test/java/org/onosproject/d/config/sync/impl/DynamicDeviceConfigSynchronizerTest.java
@@ -16,6 +16,7 @@
 package org.onosproject.d.config.sync.impl;
 
 import static org.junit.Assert.*;
+import static org.onosproject.d.config.ResourceIds.ROOT_ID;
 
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CountDownLatch;
@@ -61,6 +62,9 @@
 
     CountDownLatch providerCalled = new CountDownLatch(1);
 
+    /**
+     * DynamicConfigService.readNode(ResourceId, Filter) stub.
+     */
     BiFunction<ResourceId, Filter, DataNode> onDcsRead;
 
     BiFunction<DeviceId, SetRequest, CompletableFuture<SetResponse>> onSetConfiguration;
@@ -89,12 +93,13 @@
         ResourceId devicePath = DeviceResourceIds.toResourceId(DID);
         ResourceId cfgPath = REL_INTERFACES;
         ResourceId absPath = ResourceIds.concat(devicePath, cfgPath);
-        DynamicConfigEvent event = new DynamicConfigEvent(DynamicConfigEvent.Type.NODE_REPLACED, absPath);
+        ResourceId evtPath = ResourceIds.relativize(ROOT_ID, absPath);
+        DynamicConfigEvent event = new DynamicConfigEvent(DynamicConfigEvent.Type.NODE_REPLACED, evtPath);
 
         // assertions
         onDcsRead = (path, filter) -> {
             assertTrue(filter.isEmptyFilter());
-            assertEquals("DCS get access by absolute RID", absPath, path);
+            assertEquals("DCService get access by root relative RID", evtPath, path);
             return deviceConfigNode();
         };