Lazily create schema context in GlobalBundleScanning*
[mdsal.git] / dom / mdsal-dom-broker / src / test / java / org / opendaylight / mdsal / dom / broker / osgi / OsgiBundleScanningSchemaServiceTest.java
index 31343abd6558e9d293784e2cebf4c115f18cf21e..6ee0dd17168c2cda97375ec7b6dc5e1705bf1b21 100644 (file)
@@ -17,7 +17,6 @@ import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
-import java.lang.reflect.Method;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -67,10 +66,7 @@ public class OsgiBundleScanningSchemaServiceTest {
         doNothing().when(schemaContextListener).onGlobalContextUpdated(schemaContext);
         osgiService.registerSchemaContextListener(schemaContextListener);
 
-        final Method schemaContextUpdate =
-                OsgiBundleScanningSchemaService.class.getDeclaredMethod("updateContext", SchemaContext.class);
-        schemaContextUpdate.setAccessible(true);
-        schemaContextUpdate.invoke(osgiService, schemaContext);
+        osgiService.notifyListeners(schemaContext);
 
         doReturn(schemaContextListener).when(bundleContext).getService(null);
         assertEquals(schemaContextListener, osgiService.addingService(null));