Migrate restconf to MD-SAL APIs
[netconf.git] / restconf / restconf-nb-bierman02 / src / test / java / org / opendaylight / controller / sal / restconf / impl / test / RestconfImplNotificationSubscribingTest.java
index 54742ce0d866fb0ac3a7371561d317177d531504..ddf793e289c1a467fa7879bbc7bf646ebfd676a0 100644 (file)
@@ -25,8 +25,8 @@ import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
 import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
 import org.opendaylight.netconf.sal.restconf.impl.BrokerFacade;
 import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
 import org.opendaylight.netconf.sal.restconf.impl.RestconfImpl;
@@ -58,6 +58,7 @@ public class RestconfImplNotificationSubscribingTest {
     private UriInfo uriInfo;
 
     private ControllerContext controllerContext;
+    private RestconfImpl restconfImpl;
 
     @BeforeClass
     public static void init() throws FileNotFoundException {
@@ -68,10 +69,8 @@ public class RestconfImplNotificationSubscribingTest {
     public void setup() throws Exception {
         MockitoAnnotations.initMocks(this);
 
-        RestconfImpl.getInstance().setBroker(this.broker);
-
         controllerContext = TestRestconfUtils.newControllerContext(schemaContext);
-        RestconfImpl.getInstance().setControllerContext(controllerContext);
+        restconfImpl = RestconfImpl.newInstance(broker, controllerContext);
 
         final YangInstanceIdentifier path = Mockito.mock(YangInstanceIdentifier.class);
         final PathArgument pathValue = NodeIdentifier.create(QName.create("module", "2016-12-14", "localName"));
@@ -240,7 +239,7 @@ public class RestconfImplNotificationSubscribingTest {
             set.add(entry);
         }
         Mockito.when(map.entrySet()).thenReturn(set);
-        RestconfImpl.getInstance().subscribeToStream(this.identifier, this.uriInfo);
+        restconfImpl.subscribeToStream(this.identifier, this.uriInfo);
     }
 
 }