ItmModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.impl.rev141210.AbstractItmModule { @Override public java.lang.AutoCloseable createInstance() { ItmProvider provider = new ItmProvider(); provider.setMdsalApiManager(getMdsalutilDependency()); provider.setNotificationPublishService(getNotificationPublishServiceDependency()); provider.setNotificationService(getNotificationServiceDependency()); provider.setRpcProviderRegistry(getRpcregistryDependency()); getBrokerDependency().registerProvider(provider); return provider; } ItmModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver);  ItmModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.itm.impl.rev141210.ItmModule oldModule, java.lang.AutoCloseable oldInstance); @Override void customValidation(); @Override java.lang.AutoCloseable createInstance();  }
@Test public void testCreateInstance() throws Exception { DependencyResolver dependencyResolver = mock(DependencyResolver.class); BindingAwareBroker broker = mock(BindingAwareBroker.class); when(dependencyResolver.resolveInstance(eq(BindingAwareBroker.class), any(ObjectName.class), any(JmxAttribute.class))).thenReturn(broker); ItmModule module = new ItmModule(mock(ModuleIdentifier.class), dependencyResolver); AutoCloseable closeable = module.getInstance(); verify(broker).registerProvider((ItmProvider)closeable); closeable.close(); }