X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb-bierman02%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frest%2Fimpl%2Ftest%2Fproviders%2FTestJsonBodyReaderMountPoint.java;h=675425704d1f843414a41d7da0849e31f2987f0f;hb=cb1d2f74b370c16357af975a136e687fba3303e6;hp=328e6182c135240c2e908e6fcc234a7eeee32f7d;hpb=72bcb09b111b10f7db3af61b9e4a628291eec209;p=netconf.git diff --git a/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestJsonBodyReaderMountPoint.java b/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestJsonBodyReaderMountPoint.java index 328e6182c1..675425704d 100644 --- a/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestJsonBodyReaderMountPoint.java +++ b/restconf/restconf-nb-bierman02/src/test/java/org/opendaylight/controller/sal/rest/impl/test/providers/TestJsonBodyReaderMountPoint.java @@ -10,11 +10,8 @@ package org.opendaylight.controller.sal.rest.impl.test.providers; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import com.google.common.base.Optional; import java.io.File; import java.io.InputStream; import java.net.URI; @@ -23,10 +20,8 @@ import javax.ws.rs.core.MediaType; import org.junit.BeforeClass; import org.junit.Test; import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint; -import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService; import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils; import org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader; -import org.opendaylight.netconf.sal.restconf.impl.ControllerContext; import org.opendaylight.restconf.common.context.NormalizedNodeContext; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; @@ -49,9 +44,9 @@ public class TestJsonBodyReaderMountPoint extends AbstractBodyReaderTest { private static final QNameModule INSTANCE_IDENTIFIER_MODULE_QNAME = QNameModule.create( URI.create("instance:identifier:module"), Revision.of("2014-01-17")); - public TestJsonBodyReaderMountPoint() throws NoSuchFieldException, - SecurityException { - this.jsonBodyReader = new JsonNormalizedNodeBodyReader(); + public TestJsonBodyReaderMountPoint() throws NoSuchFieldException, SecurityException { + super(schemaContext, mock(DOMMountPoint.class)); + this.jsonBodyReader = new JsonNormalizedNodeBodyReader(controllerContext); } @Override @@ -64,15 +59,6 @@ public class TestJsonBodyReaderMountPoint extends AbstractBodyReaderTest { final Collection testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang"); testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc")); schemaContext = YangParserTestUtils.parseYangFiles(testFiles); - - final DOMMountPoint mountInstance = mock(DOMMountPoint.class); - when(mountInstance.getSchemaContext()).thenReturn(schemaContext); - final DOMMountPointService mockMountService = mock(DOMMountPointService.class); - when(mockMountService.getMountPoint(any(YangInstanceIdentifier.class))) - .thenReturn(Optional.of(mountInstance)); - - ControllerContext.getInstance().setMountService(mockMountService); - CONTROLLER_CONTEXT.setSchemas(schemaContext); } @Test