yag-library-version is a YANG string, hence the leaf needs to be
set appropriately.
JIRA: NETCONF-606
Change-Id: Iae705bf924de943871b49a8d3b39f7b7b4a55906
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
c3338ee3c2a3250ec98a4a6a0f4fcf3322e0dec2)
QName.create(RestconfModule.IETF_RESTCONF_QNAME, RestconfModule.LIB_VER_LEAF_SCHEMA_NODE));
final InstanceIdentifierContext<? extends SchemaNode> iid =
new InstanceIdentifierContext<>(yangIId, schemaNode, null, context);
QName.create(RestconfModule.IETF_RESTCONF_QNAME, RestconfModule.LIB_VER_LEAF_SCHEMA_NODE));
final InstanceIdentifierContext<? extends SchemaNode> iid =
new InstanceIdentifierContext<>(yangIId, schemaNode, null, context);
- final NormalizedNode<?, ?> data =
- Builders.leafBuilder((LeafSchemaNode) schemaNode).withValue(IetfYangLibrary.REVISION).build();
+ final NormalizedNode<?, ?> data = Builders.leafBuilder((LeafSchemaNode) schemaNode)
+ .withValue(IetfYangLibrary.REVISION.toString()).build();
return new NormalizedNodeContext(iid, data);
}
return new NormalizedNodeContext(iid, data);
}
*/
package org.opendaylight.restconf.nb.rfc8040.services.simple.impl;
*/
package org.opendaylight.restconf.nb.rfc8040.services.simple.impl;
-import org.junit.Assert;
+import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
import org.opendaylight.restconf.common.context.NormalizedNodeContext;
import org.opendaylight.restconf.nb.rfc8040.Rfc8040.IetfYangLibrary;
import org.junit.Test;
import org.opendaylight.restconf.common.context.NormalizedNodeContext;
import org.opendaylight.restconf.nb.rfc8040.Rfc8040.IetfYangLibrary;
final RestconfImpl restconfImpl = new RestconfImpl(schemaContextHandler);
final NormalizedNodeContext libraryVersion = restconfImpl.getLibraryVersion();
final LeafNode<?> value = (LeafNode<?>) libraryVersion.getData();
final RestconfImpl restconfImpl = new RestconfImpl(schemaContextHandler);
final NormalizedNodeContext libraryVersion = restconfImpl.getLibraryVersion();
final LeafNode<?> value = (LeafNode<?>) libraryVersion.getData();
- Assert.assertEquals(IetfYangLibrary.REVISION, value.getValue());
+ assertEquals(IetfYangLibrary.REVISION.toString(), value.getValue());