From f22bcd2c7a36e4ae3c5bc205aaa319f70e7a5321 Mon Sep 17 00:00:00 2001 From: Jozef Gloncak Date: Tue, 5 Aug 2014 12:49:11 +0200 Subject: [PATCH] Migrate to junit 4.11 - failing test Corrected test which caused problems in https://git.opendaylight.org/gerrit/#/c/9670/ Change-Id: Ife89b83bbc1d2df4dc34327e5f27ed47509a8b48 Signed-off-by: Jozef Gloncak --- .../sal/restconf/impl/test/RestGetOperationTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java index d4f6909081..e9d94b1184 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java @@ -61,6 +61,7 @@ import org.opendaylight.controller.sal.restconf.impl.RestconfImpl; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; @@ -905,6 +906,9 @@ public class RestGetOperationTest extends JerseyTest { expectLeaf("depth3-leaf1", "depth3-leaf1-value"))); } + /** + * Tests behavior when invalid value of depth URI parameter + */ @Test public void getDataWithInvalidDepthParameterTest() { @@ -931,6 +935,10 @@ public class RestGetOperationTest extends JerseyTest { private void getDataWithInvalidDepthParameterTest(final UriInfo uriInfo) { try { + QName qNameDepth1Cont = QName.create("urn:nested:module", "2014-06-3", "depth1-cont"); + YangInstanceIdentifier ii = YangInstanceIdentifier.builder().node(qNameDepth1Cont).build(); + NormalizedNode value = (NormalizedNode)(Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(qNameDepth1Cont)).build()); + when(brokerFacade.readConfigurationData(eq(ii))).thenReturn(value); restconfImpl.readConfigurationData("nested-module:depth1-cont", uriInfo); fail("Expected RestconfDocumentedException"); } catch (RestconfDocumentedException e) { -- 2.36.6