Use SchemaContextHandler non-statically
[netconf.git] / restconf / restconf-nb-rfc8040 / src / test / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / patch / JsonPatchBodyReaderTest.java
index e5824c9217cffdf98267b068a4a25a1bbdb03079..770746ce81f8df7ba6d6307ff3ed18356c85f312 100644 (file)
@@ -21,7 +21,6 @@ import org.junit.Test;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.patch.PatchContext;
-import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.AbstractBodyReaderTest;
 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.test.JsonBodyReaderTest;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -32,7 +31,8 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
     private static SchemaContext schemaContext;
 
     public JsonPatchBodyReaderTest() throws Exception {
-        jsonToPatchBodyReader = new JsonToPatchBodyReader();
+        super(schemaContext);
+        jsonToPatchBodyReader = new JsonToPatchBodyReader(schemaContextHandler);
     }
 
     @Override
@@ -44,7 +44,6 @@ public class JsonPatchBodyReaderTest extends AbstractBodyReaderTest {
     public static void initialization() {
         schemaContext = schemaContextLoader("/instanceidentifier/yang", schemaContext);
         when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mock(DOMMountPointService.class));
-        SchemaContextHandler.setSchemaContext(schemaContext);
     }
 
     @Test