Use DOMMountPointServiceHandler non-statically
[netconf.git] / restconf / restconf-nb-rfc8040 / src / test / java / org / opendaylight / restconf / nb / rfc8040 / services / simple / impl / RestconfSchemaServiceTest.java
index 80b9231159cd8515c135a22db3cb2e0546b28511..d9b280212ec512e6565d4b4588e93c94a3db28ec 100644 (file)
@@ -63,8 +63,6 @@ public class RestconfSchemaServiceTest {
     @Mock
     private SchemaContextHandler mockContextHandler;
     @Mock
-    private DOMMountPointServiceHandler mockMountPointHandler;
-    @Mock
     private DOMYangTextSourceProvider sourceProvider;
 
     // schema context with modules
@@ -107,10 +105,9 @@ public class RestconfSchemaServiceTest {
         this.mountPointService = new DOMMountPointServiceImpl();
         ((DOMMountPointServiceImpl) this.mountPointService).registerMountPoint(this.mountPoint);
         ((DOMMountPointServiceImpl) this.mountPointService).registerMountPoint(this.mountPointWithNullSchemaContext);
-        when(this.mockMountPointHandler.get()).thenReturn(this.mountPointService);
 
-        this.schemaService = new RestconfSchemaServiceImpl(this.mockContextHandler, this.mockMountPointHandler,
-                sourceProvider);
+        this.schemaService = new RestconfSchemaServiceImpl(this.mockContextHandler,
+                DOMMountPointServiceHandler.newInstance(mountPointService), sourceProvider);
     }
 
     /**