Replace old yang parser usages in restconf
[netconf.git] / restconf / sal-rest-connector / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / RestDeleteOperationTest.java
index 8d5f15d7c72a71c01c353344004f5155109b4d78..53b37fb29cd83dec2d5d2e72c1c724de6f603a8a 100644 (file)
@@ -13,7 +13,6 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-
 import com.google.common.util.concurrent.CheckedFuture;
 import java.io.FileNotFoundException;
 import java.io.UnsupportedEncodingException;
@@ -37,6 +36,7 @@ import org.opendaylight.netconf.sal.restconf.impl.RestconfImpl;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 
 public class RestDeleteOperationTest extends JerseyTest {
 
@@ -45,10 +45,11 @@ public class RestDeleteOperationTest extends JerseyTest {
     private static RestconfImpl restconfImpl;
 
     @BeforeClass
-    public static void init() throws FileNotFoundException {
-        final Set<Module> allModules = TestUtils.loadModulesFrom("/test-config-data/yang1");
+    public static void init() throws FileNotFoundException, ReactorException {
+        final SchemaContext schemaContext = TestUtils.loadSchemaContext("/test-config-data/yang1");
+        final Set<Module> allModules = schemaContext.getModules();
         assertNotNull(allModules);
-        final SchemaContext schemaContext = TestUtils.loadSchemaContext(allModules);
+
         controllerContext = ControllerContext.getInstance();
         controllerContext.setSchemas(schemaContext);
         brokerFacade = mock(BrokerFacade.class);