import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
import org.opendaylight.controller.sal.rest.impl.test.providers.AbstractBodyReaderTest;
import org.opendaylight.netconf.sal.rest.impl.NormalizedNodeJsonBodyWriter;
-import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.restconf.common.context.NormalizedNodeContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public class NnToJsonLeafrefType extends AbstractBodyReaderTest {
- private static SchemaContext schemaContext;
+ private static EffectiveModelContext schemaContext;
private final NormalizedNodeJsonBodyWriter jsonBodyWriter;
- public NnToJsonLeafrefType() throws NoSuchFieldException, SecurityException {
- super();
+ public NnToJsonLeafrefType() {
+ super(schemaContext, null);
jsonBodyWriter = new NormalizedNodeJsonBodyWriter();
}
@BeforeClass
public static void initialization() {
- schemaContext = schemaContextLoader("/nn-to-json/leafref",
- schemaContext);
- CONTROLLER_CONTEXT.setSchemas(schemaContext);
+ schemaContext = schemaContextLoader("/nn-to-json/leafref", schemaContext);
}
@Test
final String pathToInputFile = xmlDataPath;
final NormalizedNodeContext testNN = TestRestconfUtils
- .loadNormalizedContextFromXmlFile(pathToInputFile, uri);
+ .loadNormalizedContextFromXmlFile(pathToInputFile, uri, controllerContext);
final OutputStream output = new ByteArrayOutputStream();
jsonBodyWriter.writeTo(testNN, null, null, null, mediaType, null,