Use ControllerContext non-statically
[netconf.git] / restconf / restconf-nb-bierman02 / src / test / java / org / opendaylight / controller / sal / rest / impl / test / providers / TestJsonBodyWriter.java
index 8f7b008ec66fd75787cad7d169daf9ef83a923cd..24c58a03ad5e0c8191c0207ead99e6a4918503ab 100644 (file)
@@ -31,9 +31,10 @@ public class TestJsonBodyWriter extends AbstractBodyReaderTest {
     private final NormalizedNodeJsonBodyWriter jsonBodyWriter;
     private static SchemaContext schemaContext;
 
-    public TestJsonBodyWriter() throws NoSuchFieldException, SecurityException {
+    public TestJsonBodyWriter() {
+        super(schemaContext, null);
         this.jsonBodyWriter = new NormalizedNodeJsonBodyWriter();
-        this.jsonBodyReader = new JsonNormalizedNodeBodyReader();
+        this.jsonBodyReader = new JsonNormalizedNodeBodyReader(controllerContext);
     }
 
     @Override
@@ -46,7 +47,6 @@ public class TestJsonBodyWriter extends AbstractBodyReaderTest {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
         testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangFiles(testFiles);
-        CONTROLLER_CONTEXT.setSchemas(schemaContext);
     }
 
     @Test