From: Robert Varga Date: Thu, 7 Feb 2019 19:07:27 +0000 (+0100) Subject: Fix Revision confusion X-Git-Tag: release/neon~2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=netconf.git;a=commitdiff_plain;h=6c603388033f870807dfd8e284cb938d24d68f27 Fix Revision confusion 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 (cherry picked from commit c3338ee3c2a3250ec98a4a6a0f4fcf3322e0dec2) --- diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImpl.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImpl.java index da89d99bcf..e3db40ba72 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImpl.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImpl.java @@ -49,8 +49,8 @@ public class RestconfImpl implements RestconfService { QName.create(RestconfModule.IETF_RESTCONF_QNAME, RestconfModule.LIB_VER_LEAF_SCHEMA_NODE)); final InstanceIdentifierContext 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); } diff --git a/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImplTest.java b/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImplTest.java index bec5c7be12..01aa0f409e 100644 --- a/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImplTest.java +++ b/restconf/restconf-nb-rfc8040/src/test/java/org/opendaylight/restconf/nb/rfc8040/services/simple/impl/RestconfImplTest.java @@ -7,7 +7,8 @@ */ 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; @@ -28,6 +29,6 @@ public class RestconfImplTest { 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()); } }