diff --git a/cps-dependencies/pom.xml b/cps-dependencies/pom.xml
index e69e571..9f389cf 100755
--- a/cps-dependencies/pom.xml
+++ b/cps-dependencies/pom.xml
@@ -87,7 +87,7 @@
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>6.0.1</version>
+                <version>8.0.6</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
index 400e9b3..8008e03 100755
--- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
+++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
@@ -60,9 +60,9 @@
 import org.onap.cps.spi.repository.SchemaSetRepository;
 import org.onap.cps.spi.repository.YangResourceRepository;
 import org.opendaylight.yangtools.yang.common.Revision;
-import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
+import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangModelDependencyInfo;
 import org.springframework.dao.DataIntegrityViolationException;
 import org.springframework.retry.annotation.Backoff;
@@ -252,6 +252,11 @@
 
         final var tempYangTextSchemaSource = new YangTextSchemaSource(revisionSourceIdentifier) {
             @Override
+            public Optional<String> getSymbolicName() {
+                return Optional.empty();
+            }
+
+            @Override
             protected MoreObjects.ToStringHelper addToStringAttributes(
                     final MoreObjects.ToStringHelper toStringHelper) {
                 return toStringHelper;
diff --git a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java
index 88ebe3b..b08d8c1 100755
--- a/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java
+++ b/cps-service/src/main/java/org/onap/cps/api/impl/CpsDataServiceImpl.java
@@ -226,11 +226,11 @@
         final SchemaContext schemaContext = getSchemaContext(dataspaceName, anchor.getSchemaSetName());
 
         if (ROOT_NODE_XPATH.equals(parentNodeXpath)) {
-            final NormalizedNode<?, ?> normalizedNode = YangUtils.parseJsonData(jsonData, schemaContext);
+            final NormalizedNode normalizedNode = YangUtils.parseJsonData(jsonData, schemaContext);
             return new DataNodeBuilder().withNormalizedNodeTree(normalizedNode).build();
         }
 
-        final NormalizedNode<?, ?> normalizedNode = YangUtils.parseJsonData(jsonData, schemaContext, parentNodeXpath);
+        final NormalizedNode normalizedNode = YangUtils.parseJsonData(jsonData, schemaContext, parentNodeXpath);
         return new DataNodeBuilder()
             .withParentNodeXpath(parentNodeXpath)
             .withNormalizedNodeTree(normalizedNode)
@@ -252,7 +252,7 @@
         final Anchor anchor = cpsAdminService.getAnchor(dataspaceName, anchorName);
         final SchemaContext schemaContext = getSchemaContext(dataspaceName, anchor.getSchemaSetName());
 
-        final NormalizedNode<?, ?> normalizedNode = YangUtils.parseJsonData(jsonData, schemaContext, parentNodeXpath);
+        final NormalizedNode normalizedNode = YangUtils.parseJsonData(jsonData, schemaContext, parentNodeXpath);
         final Collection<DataNode> dataNodes = new DataNodeBuilder()
             .withParentNodeXpath(parentNodeXpath)
             .withNormalizedNodeTree(normalizedNode)
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java b/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java
index f2bde03..eaa2d77 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java
@@ -44,7 +44,7 @@
 @Slf4j
 public class DataNodeBuilder {
 
-    private NormalizedNode<?, ?> normalizedNodeTree;
+    private NormalizedNode normalizedNodeTree;
     private String xpath;
     private String moduleNamePrefix;
     private String parentNodeXpath = "";
@@ -69,7 +69,7 @@
      * @param normalizedNodeTree used for creating the Data Node
      * @return this {@link DataNodeBuilder} object
      */
-    public DataNodeBuilder withNormalizedNodeTree(final NormalizedNode<?, ?> normalizedNodeTree) {
+    public DataNodeBuilder withNormalizedNodeTree(final NormalizedNode normalizedNodeTree) {
         this.normalizedNodeTree = normalizedNodeTree;
         return this;
     }
@@ -171,15 +171,16 @@
     }
 
     private static void addDataNodeFromNormalizedNode(final DataNode currentDataNode,
-        final NormalizedNode<?, ?> normalizedNode) {
+        final NormalizedNode normalizedNode) {
 
         if (normalizedNode instanceof DataContainerNode) {
-            addYangContainer(currentDataNode, (DataContainerNode<?>) normalizedNode);
+            addYangContainer(currentDataNode, (DataContainerNode) normalizedNode);
         } else if (normalizedNode instanceof MapNode) {
             addDataNodeForEachListElement(currentDataNode, (MapNode) normalizedNode);
         } else if (normalizedNode instanceof ValueNode) {
-            final ValueNode<?, ?> valuesNode = (ValueNode<?, ?>) normalizedNode;
-            addYangLeaf(currentDataNode, valuesNode.getNodeType().getLocalName(), valuesNode.getValue());
+            final ValueNode<NormalizedNode> valuesNode = (ValueNode) normalizedNode;
+            addYangLeaf(currentDataNode, valuesNode.getIdentifier().getNodeType().getLocalName(),
+                    valuesNode.body());
         } else if (normalizedNode instanceof LeafSetNode) {
             addYangLeafList(currentDataNode, (LeafSetNode<?>) normalizedNode);
         } else {
@@ -187,13 +188,13 @@
         }
     }
 
-    private static void addYangContainer(final DataNode currentDataNode, final DataContainerNode<?> dataContainerNode) {
+    private static void addYangContainer(final DataNode currentDataNode, final DataContainerNode dataContainerNode) {
         final DataNode dataContainerDataNode =
             (dataContainerNode.getIdentifier() instanceof YangInstanceIdentifier.AugmentationIdentifier)
                 ? currentDataNode
                 : createAndAddChildDataNode(currentDataNode, YangUtils.buildXpath(dataContainerNode.getIdentifier()));
-        final Collection<DataContainerChild<?, ?>> normalizedChildNodes = dataContainerNode.getValue();
-        for (final NormalizedNode<?, ?> normalizedNode : normalizedChildNodes) {
+        final Collection<DataContainerChild> normalizedChildNodes = dataContainerNode.body();
+        for (final NormalizedNode normalizedNode : normalizedChildNodes) {
             addDataNodeFromNormalizedNode(dataContainerDataNode, normalizedNode);
         }
     }
@@ -207,16 +208,16 @@
     }
 
     private static void addYangLeafList(final DataNode currentDataNode, final LeafSetNode<?> leafSetNode) {
-        final String leafListName = leafSetNode.getNodeType().getLocalName();
-        final List<?> leafListValues = ((Collection<? extends NormalizedNode<?, ?>>) leafSetNode.getValue())
-            .stream()
-            .map(normalizedNode -> ((ValueNode<?, ?>) normalizedNode).getValue())
-            .collect(Collectors.toUnmodifiableList());
+        final String leafListName = leafSetNode.getIdentifier().getNodeType().getLocalName();
+        final List<?> leafListValues = ((Collection<? extends NormalizedNode>) leafSetNode.body())
+                .stream()
+                .map(normalizedNode -> (normalizedNode).body())
+                .collect(Collectors.toUnmodifiableList());
         addYangLeaf(currentDataNode, leafListName, leafListValues);
     }
 
     private static void addDataNodeForEachListElement(final DataNode currentDataNode, final MapNode mapNode) {
-        final Collection<MapEntryNode> mapEntryNodes = mapNode.getValue();
+        final Collection<MapEntryNode> mapEntryNodes = mapNode.body();
         for (final MapEntryNode mapEntryNode : mapEntryNodes) {
             addDataNodeFromNormalizedNode(currentDataNode, mapEntryNode);
         }
diff --git a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
index 8fcdc4e..48241ed 100644
--- a/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
+++ b/cps-service/src/main/java/org/onap/cps/utils/YangUtils.java
@@ -26,6 +26,7 @@
 import com.google.gson.stream.JsonReader;
 import java.io.IOException;
 import java.io.StringReader;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -36,8 +37,11 @@
 import lombok.NoArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.onap.cps.spi.exceptions.DataValidationException;
+import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
+import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactory;
 import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier;
 import org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter;
@@ -45,7 +49,10 @@
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveStatementInference;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
+import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
 
 @Slf4j
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
@@ -61,8 +68,7 @@
      * @param schemaContext schema context describing associated data model
      * @return the NormalizedNode object
      */
-    @SuppressWarnings("squid:S1452")  // Generic type <? ,?> is returned by external librray, opendaylight.yangtools
-    public static NormalizedNode<?, ?> parseJsonData(final String jsonData, final SchemaContext schemaContext) {
+    public static NormalizedNode parseJsonData(final String jsonData, final SchemaContext schemaContext) {
         return parseJsonData(jsonData, schemaContext, Optional.empty());
     }
 
@@ -74,32 +80,41 @@
      * @param parentNodeXpath the xpath referencing the parent node current data fragment belong to
      * @return the NormalizedNode object
      */
-    @SuppressWarnings("squid:S1452")  // Generic type <? ,?> is returned by external librray, opendaylight.yangtools
-    public static NormalizedNode<?, ?> parseJsonData(final String jsonData, final SchemaContext schemaContext,
+    public static NormalizedNode parseJsonData(final String jsonData, final SchemaContext schemaContext,
         final String parentNodeXpath) {
-        final var parentSchemaNode = getDataSchemaNodeByXpath(parentNodeXpath, schemaContext);
-        return parseJsonData(jsonData, schemaContext, Optional.of(parentSchemaNode));
+        final Collection<QName> dataSchemaNodeIdentifiers =
+                getDataSchemaNodeIdentifiersByXpath(parentNodeXpath, schemaContext);
+        return parseJsonData(jsonData, schemaContext, Optional.of(dataSchemaNodeIdentifiers));
     }
 
-    private static NormalizedNode<?, ?> parseJsonData(final String jsonData, final SchemaContext schemaContext,
-        final Optional<DataSchemaNode> optionalParentSchemaNode) {
-        final var jsonCodecFactory = JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02
+    private static NormalizedNode parseJsonData(final String jsonData, final SchemaContext schemaContext,
+        final Optional<Collection<QName>> dataSchemaNodeIdentifiers) {
+        final JSONCodecFactory jsonCodecFactory = JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02
             .getShared((EffectiveModelContext) schemaContext);
-        final var normalizedNodeResult = new NormalizedNodeResult();
-        final var normalizedNodeStreamWriter = ImmutableNormalizedNodeStreamWriter
+        final NormalizedNodeResult normalizedNodeResult = new NormalizedNodeResult();
+        final NormalizedNodeStreamWriter normalizedNodeStreamWriter = ImmutableNormalizedNodeStreamWriter
             .from(normalizedNodeResult);
+        final JsonReader jsonReader = new JsonReader(new StringReader(jsonData));
+        final JsonParserStream jsonParserStream;
 
-        try (final JsonParserStream jsonParserStream = optionalParentSchemaNode.isPresent()
-            ? JsonParserStream.create(normalizedNodeStreamWriter, jsonCodecFactory, optionalParentSchemaNode.get())
-            : JsonParserStream.create(normalizedNodeStreamWriter, jsonCodecFactory)
-        ) {
-            final var jsonReader = new JsonReader(new StringReader(jsonData));
+        if (dataSchemaNodeIdentifiers.isPresent()) {
+            final EffectiveModelContext effectiveModelContext = ((EffectiveModelContext) schemaContext);
+            final EffectiveStatementInference effectiveStatementInference =
+                    SchemaInferenceStack.of(effectiveModelContext,
+                    SchemaNodeIdentifier.Absolute.of(dataSchemaNodeIdentifiers.get())).toInference();
+            jsonParserStream =
+                    JsonParserStream.create(normalizedNodeStreamWriter, jsonCodecFactory, effectiveStatementInference);
+        } else {
+            jsonParserStream = JsonParserStream.create(normalizedNodeStreamWriter, jsonCodecFactory);
+        }
+
+        try {
             jsonParserStream.parse(jsonReader);
-
-        } catch (final IOException | JsonSyntaxException exception) {
+            jsonParserStream.close();
+        } catch (final JsonSyntaxException exception) {
             throw new DataValidationException(
                 "Failed to parse json data: " + jsonData, exception.getMessage(), exception);
-        } catch (final IllegalStateException illegalStateException) {
+        } catch (final IOException | IllegalStateException illegalStateException) {
             throw new DataValidationException(
                 "Failed to parse json data. Unsupported xpath or json data:" + jsonData, illegalStateException
                 .getMessage(), illegalStateException);
@@ -114,7 +129,7 @@
      * @return an xpath
      */
     public static String buildXpath(final YangInstanceIdentifier.PathArgument nodeIdentifier) {
-        final var xpathBuilder = new StringBuilder();
+        final StringBuilder xpathBuilder = new StringBuilder();
         xpathBuilder.append("/").append(nodeIdentifier.getNodeType().getLocalName());
 
         if (nodeIdentifier instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates) {
@@ -143,10 +158,11 @@
         }
     }
 
-    private static DataSchemaNode getDataSchemaNodeByXpath(final String parentNodeXpath,
-        final SchemaContext schemaContext) {
+    private static Collection<QName> getDataSchemaNodeIdentifiersByXpath(final String parentNodeXpath,
+                                                                      final SchemaContext schemaContext) {
         final String[] xpathNodeIdSequence = xpathToNodeIdSequence(parentNodeXpath);
-        return findDataSchemaNodeByXpathNodeIdSequence(xpathNodeIdSequence, schemaContext.getChildNodes());
+        return findDataSchemaNodeIdentifiersByXpathNodeIdSequence(xpathNodeIdSequence, schemaContext.getChildNodes(),
+                new ArrayList<>());
     }
 
     private static String[] xpathToNodeIdSequence(final String xpath) {
@@ -161,25 +177,29 @@
         return xpathNodeIdSequence;
     }
 
-    private static DataSchemaNode findDataSchemaNodeByXpathNodeIdSequence(final String[] xpathNodeIdSequence,
-        final Collection<? extends DataSchemaNode> dataSchemaNodes) {
+    private static Collection<QName> findDataSchemaNodeIdentifiersByXpathNodeIdSequence(
+            final String[] xpathNodeIdSequence,
+            final Collection<? extends DataSchemaNode> dataSchemaNodes,
+            final Collection<QName> dataSchemaNodeIdentifiers) {
         final String currentXpathNodeId = xpathNodeIdSequence[0];
         final DataSchemaNode currentDataSchemaNode = dataSchemaNodes.stream()
             .filter(dataSchemaNode -> currentXpathNodeId.equals(dataSchemaNode.getQName().getLocalName()))
             .findFirst().orElseThrow(() -> schemaNodeNotFoundException(currentXpathNodeId));
+        dataSchemaNodeIdentifiers.add(currentDataSchemaNode.getQName());
         if (xpathNodeIdSequence.length <= 1) {
-            return currentDataSchemaNode;
+            return dataSchemaNodeIdentifiers;
         }
         if (currentDataSchemaNode instanceof DataNodeContainer) {
-            return findDataSchemaNodeByXpathNodeIdSequence(
+            return findDataSchemaNodeIdentifiersByXpathNodeIdSequence(
                 getNextLevelXpathNodeIdSequence(xpathNodeIdSequence),
-                ((DataNodeContainer) currentDataSchemaNode).getChildNodes());
+                    ((DataNodeContainer) currentDataSchemaNode).getChildNodes(),
+                    dataSchemaNodeIdentifiers);
         }
         throw schemaNodeNotFoundException(xpathNodeIdSequence[1]);
     }
 
     private static String[] getNextLevelXpathNodeIdSequence(final String[] xpathNodeIdSequence) {
-        final var nextXpathNodeIdSequence = new String[xpathNodeIdSequence.length - 1];
+        final String[] nextXpathNodeIdSequence = new String[xpathNodeIdSequence.length - 1];
         System.arraycopy(xpathNodeIdSequence, 1, nextXpathNodeIdSequence, 0, nextXpathNodeIdSequence.length);
         return nextXpathNodeIdSequence;
     }
diff --git a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java
index fd53497..e0f24f3 100644
--- a/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java
+++ b/cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java
@@ -32,6 +32,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Optional;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import lombok.NoArgsConstructor;
@@ -41,9 +42,9 @@
 import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
+import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
@@ -155,6 +156,11 @@
 
         return new YangTextSchemaSource(revisionSourceIdentifier) {
             @Override
+            public Optional<String> getSymbolicName() {
+                return Optional.empty();
+            }
+
+            @Override
             protected MoreObjects.ToStringHelper addToStringAttributes(
                 final MoreObjects.ToStringHelper toStringHelper) {
                 return toStringHelper;
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/JsonParserStreamSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/JsonParserStreamSpec.groovy
index 68f9251..40f0e0a 100644
--- a/cps-service/src/test/groovy/org/onap/cps/utils/JsonParserStreamSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/utils/JsonParserStreamSpec.groovy
@@ -10,7 +10,7 @@
 import org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter
-import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.DataContainerNodeBuilder
+import org.opendaylight.yangtools.yang.data.api.schema.builder.DataContainerNodeBuilder
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import spock.lang.Specification
 import org.onap.cps.TestUtils
@@ -38,10 +38,10 @@
         then: 'result is the correct size'
             result.size() == 2
         then: 'data container child is a type of normalized node'
-            def dataContainerChild = result.getValue()[index]
+            def dataContainerChild = result.body().getAt(index)
             dataContainerChild instanceof NormalizedNode == true
         then: 'qualified name created is as expected'
-            dataContainerChild.nodeType == QName.create('org:onap:ccsdk:multiDataTree', '2020-09-15', nodeName)
+            dataContainerChild.identifier.nodeType == QName.create('org:onap:ccsdk:multiDataTree', '2020-09-15', nodeName)
         where:
             index   | nodeName
             0       | 'first-container'
diff --git a/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy b/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy
index 3f19091..65aa3af 100644
--- a/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy
+++ b/cps-service/src/test/groovy/org/onap/cps/utils/YangUtilsSpec.groovy
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation
+ *  Copyright (C) 2020-2022 Nordix Foundation
  *  Modifications Copyright (C) 2021 Pantheon.tech
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
@@ -36,9 +36,9 @@
             def yangResourceNameToContent = TestUtils.getYangResourcesAsMap('bookstore.yang')
             def schemaContext = YangTextSchemaSourceSetBuilder.of(yangResourceNameToContent).getSchemaContext()
         when: 'the json data is parsed'
-            NormalizedNode<?, ?> result = YangUtils.parseJsonData(jsonData, schemaContext)
+            NormalizedNode result = YangUtils.parseJsonData(jsonData, schemaContext)
         then: 'the result is a normalized node of the correct type'
-            result.nodeType == QName.create('org:onap:ccsdk:sample', '2020-09-15', 'bookstore')
+            result.getIdentifier().nodeType == QName.create('org:onap:ccsdk:sample', '2020-09-15', 'bookstore')
     }
 
     def 'Parsing invalid data: #description.'() {
@@ -63,7 +63,7 @@
         when: 'json string is parsed'
             def result = YangUtils.parseJsonData(jsonData, schemaContext, parentNodeXpath)
         then: 'result represents a node of expected type'
-            result.nodeType == QName.create('org:onap:cps:test:test-tree', '2020-02-02', nodeName)
+            result.getIdentifier().nodeType == QName.create('org:onap:cps:test:test-tree', '2020-02-02', nodeName)
         where:
             scenario                    | jsonData                                                                      | parentNodeXpath                       || nodeName
             'list element as container' | '{ "branch": { "name": "B", "nest": { "name": "N", "birds": ["bird"] } } }'   | '/test-tree'                          || 'branch'
