Bump yangtools to 13.0.0
[mdsal.git] / binding / mdsal-binding-dom-adapter / src / test / java / org / opendaylight / mdsal / binding / dom / adapter / test / util / BindingTestContext.java
index 5a80df68ce56a8aea8c7a7e49bfc310e7435e4e8..3d347256a51404ce6ed1130fa47eea6e2f0b054e 100644 (file)
@@ -99,10 +99,8 @@ public class BindingTestContext implements AutoCloseable {
 
     public void startNewDomDataBroker() {
         checkState(executor != null, "Executor needs to be set");
-        final InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER",
-            MoreExecutors.newDirectExecutorService());
-        final InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG",
-            MoreExecutors.newDirectExecutorService());
+        final var operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.newDirectExecutorService());
+        final var configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.newDirectExecutorService());
         newDatastores = ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
                 .put(LogicalDatastoreType.OPERATIONAL, operStore)
                 .put(LogicalDatastoreType.CONFIGURATION, configStore)
@@ -110,8 +108,8 @@ public class BindingTestContext implements AutoCloseable {
 
         newDOMDataBroker = new SerializedDOMDataBroker(newDatastores, executor);
 
-        mockSchemaService.registerSchemaContextListener(configStore);
-        mockSchemaService.registerSchemaContextListener(operStore);
+        mockSchemaService.registerSchemaContextListener(configStore::onModelContextUpdated);
+        mockSchemaService.registerSchemaContextListener(operStore::onModelContextUpdated);
     }
 
     public void startBindingDataBroker() {
@@ -139,7 +137,7 @@ public class BindingTestContext implements AutoCloseable {
     }
 
     public EffectiveModelContext getContext() {
-        return mockSchemaService.getEffectiveModelContext();
+        return mockSchemaService.getGlobalContext();
     }
 
     public void start() {
@@ -167,8 +165,7 @@ public class BindingTestContext implements AutoCloseable {
 
     private void startDomBroker() {
         checkState(executor != null);
-        domRouter = new DOMRpcRouter();
-        mockSchemaService.registerSchemaContextListener(domRouter);
+        domRouter = new DOMRpcRouter(mockSchemaService);
     }
 
     public void startBindingNotificationBroker() {