Bump upstreams for Silicon
[netconf.git] / restconf / restconf-nb-bierman02 / src / test / java / org / opendaylight / netconf / sal / streams / listeners / NotificationListenerTest.java
index b642129fb830716dbc591d47c0a9e38f8e6e488f..b30991be779832be5dd5cafd0a6f5be5f397d7cc 100644 (file)
@@ -47,6 +47,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
 
 public class NotificationListenerTest {
     private static final QNameModule MODULE = QNameModule.create(URI.create("notifi:mod"), Revision.of("2016-11-23"));
@@ -68,12 +69,12 @@ public class NotificationListenerTest {
 
     @Test
     public void notifi_leafTest() throws Exception {
-        final SchemaPath schemaPathNotifi = SchemaPath.create(false, QName.create(MODULE, "notifi-leaf"));
+        final Absolute schemaPathNotifi = Absolute.of(QName.create(MODULE, "notifi-leaf"));
 
         final DOMNotification notificationData = mock(DOMNotification.class);
 
         final LeafNode<String> leaf = mockLeaf(QName.create(MODULE, "lf"));
-        final ContainerNode notifiBody = mockCont(schemaPathNotifi.getLastComponent(), leaf);
+        final ContainerNode notifiBody = mockCont(schemaPathNotifi.lastNodeIdentifier(), leaf);
 
         when(notificationData.getType()).thenReturn(schemaPathNotifi);
         when(notificationData.getBody()).thenReturn(notifiBody);
@@ -88,13 +89,13 @@ public class NotificationListenerTest {
 
     @Test
     public void notifi_cont_leafTest() throws Exception {
-        final SchemaPath schemaPathNotifi = SchemaPath.create(false, QName.create(MODULE, "notifi-cont"));
+        final Absolute schemaPathNotifi = Absolute.of(QName.create(MODULE, "notifi-cont"));
 
         final DOMNotification notificationData = mock(DOMNotification.class);
 
         final LeafNode<String> leaf = mockLeaf(QName.create(MODULE, "lf"));
         final ContainerNode cont = mockCont(QName.create(MODULE, "cont"), leaf);
-        final ContainerNode notifiBody = mockCont(schemaPathNotifi.getLastComponent(), cont);
+        final ContainerNode notifiBody = mockCont(schemaPathNotifi.lastNodeIdentifier(), cont);
 
         when(notificationData.getType()).thenReturn(schemaPathNotifi);
         when(notificationData.getBody()).thenReturn(notifiBody);
@@ -110,7 +111,7 @@ public class NotificationListenerTest {
 
     @Test
     public void notifi_list_Test() throws Exception {
-        final SchemaPath schemaPathNotifi = SchemaPath.create(false, QName.create(MODULE, "notifi-list"));
+        final Absolute schemaPathNotifi = Absolute.of(QName.create(MODULE, "notifi-list"));
 
         final DOMNotification notificationData = mock(DOMNotification.class);
 
@@ -118,7 +119,7 @@ public class NotificationListenerTest {
         final MapEntryNode entry = mockMapEntry(QName.create(MODULE, "lst"), leaf);
         final MapNode list = mockList(QName.create(MODULE, "lst"), entry);
         final ContainerNode cont = mockCont(QName.create(MODULE, "cont"), list);
-        final ContainerNode notifiBody = mockCont(schemaPathNotifi.getLastComponent(), cont);
+        final ContainerNode notifiBody = mockCont(schemaPathNotifi.lastNodeIdentifier(), cont);
 
         when(notificationData.getType()).thenReturn(schemaPathNotifi);
         when(notificationData.getBody()).thenReturn(notifiBody);
@@ -134,12 +135,12 @@ public class NotificationListenerTest {
 
     @Test
     public void notifi_grpTest() throws Exception {
-        final SchemaPath schemaPathNotifi = SchemaPath.create(false, QName.create(MODULE, "notifi-grp"));
+        final Absolute schemaPathNotifi = Absolute.of(QName.create(MODULE, "notifi-grp"));
 
         final DOMNotification notificationData = mock(DOMNotification.class);
 
         final LeafNode<String> leaf = mockLeaf(QName.create(MODULE, "lf"));
-        final ContainerNode notifiBody = mockCont(schemaPathNotifi.getLastComponent(), leaf);
+        final ContainerNode notifiBody = mockCont(schemaPathNotifi.lastNodeIdentifier(), leaf);
 
         when(notificationData.getType()).thenReturn(schemaPathNotifi);
         when(notificationData.getBody()).thenReturn(notifiBody);
@@ -153,13 +154,13 @@ public class NotificationListenerTest {
 
     @Test
     public void notifi_augmTest() throws Exception {
-        final SchemaPath schemaPathNotifi = SchemaPath.create(false, QName.create(MODULE, "notifi-augm"));
+        final Absolute schemaPathNotifi = Absolute.of(QName.create(MODULE, "notifi-augm"));
 
         final DOMNotification notificationData = mock(DOMNotification.class);
 
         final LeafNode<String> leaf = mockLeaf(QName.create(MODULE, "lf-augm"));
         final AugmentationNode augm = mockAugm(leaf);
-        final ContainerNode notifiBody = mockCont(schemaPathNotifi.getLastComponent(), augm);
+        final ContainerNode notifiBody = mockCont(schemaPathNotifi.lastNodeIdentifier(), augm);
 
         when(notificationData.getType()).thenReturn(schemaPathNotifi);
         when(notificationData.getBody()).thenReturn(notifiBody);
@@ -226,10 +227,10 @@ public class NotificationListenerTest {
         return child;
     }
 
-    private String prepareJson(final DOMNotification notificationData, final SchemaPath schemaPathNotifi)
+    private String prepareJson(final DOMNotification notificationData, final Absolute schemaPathNotifi)
             throws Exception {
         final List<SchemaPath> paths = new ArrayList<>();
-        paths.add(schemaPathNotifi);
+        paths.add(schemaPathNotifi.asSchemaPath());
         final List<NotificationListenerAdapter> listNotifi =
                 Notificator.createNotificationListener(paths, "stream-name", NotificationOutputType.JSON.toString(),
                         controllerContext);