Bug 7433 - Remove use of YangSchemaSourceImpl from restconf tests
[netconf.git] / restconf / sal-rest-connector / src / test / java / org / opendaylight / restconf / handlers / SchemaContextHandlerTest.java
index 55d247a35370d4f905eea2a5ae501a7333427d7a..89aa8fbe1328b4c5696b419c46a59b379ab83621 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.restconf.handlers;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
+
 import com.google.common.util.concurrent.CheckedFuture;
 import org.junit.Before;
 import org.junit.Test;
@@ -19,6 +20,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 /**
  * Tests for handling {@link SchemaContext}
@@ -44,7 +46,8 @@ public class SchemaContextHandlerTest {
         Mockito.when(checked.checkedGet()).thenReturn(value);
         this.schemaContextHandler = new SchemaContextHandler(txHandler);
 
-        this.schemaContext = TestRestconfUtils.loadSchemaContext(PATH_FOR_ACTUAL_SCHEMA_CONTEXT);
+        this.schemaContext =
+                YangParserTestUtils.parseYangSources(TestRestconfUtils.loadFiles(PATH_FOR_ACTUAL_SCHEMA_CONTEXT));
         this.schemaContextHandler.onGlobalContextUpdated(this.schemaContext);
     }
 
@@ -77,7 +80,8 @@ public class SchemaContextHandlerTest {
     @Test
     public void onGlobalContextUpdateTest() throws Exception {
         // create new SchemaContext and update SchemaContextHandler
-        final SchemaContext newSchemaContext = TestRestconfUtils.loadSchemaContext(PATH_FOR_NEW_SCHEMA_CONTEXT);
+        final SchemaContext newSchemaContext =
+                YangParserTestUtils.parseYangSources(TestRestconfUtils.loadFiles(PATH_FOR_NEW_SCHEMA_CONTEXT));
         this.schemaContextHandler.onGlobalContextUpdated(newSchemaContext);
 
         assertNotEquals("SchemaContextHandler should not has reference to old SchemaContext",