use of org.opendaylight.mdsal.dom.api.DOMSchemaService in project bgpcep by opendaylight.
the class BgpDeployerImplTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
doReturn("mapping").when(this.tableTypeRegistry).toString();
doReturn(Optional.of(TABLE_TYPE)).when(this.tableTypeRegistry).getTableType(any());
doReturn(Optional.of(TABLES_KEY)).when(this.tableTypeRegistry).getTableKey(any());
doNothing().when(this.registration).unregister();
doReturn(this.registration).when(this.bundleContext).registerService(eq(InstanceType.RIB.getServices()), any(), any(Dictionary.class));
doReturn(this.registration).when(this.bundleContext).registerService(eq(InstanceType.PEER.getServices()), any(), any(Dictionary.class));
doNothing().when(this.dataTreeRegistration).close();
doReturn("bgpPeer").when(this.modification).toString();
final RIBExtensionConsumerContext extension = mock(RIBExtensionConsumerContext.class);
doReturn(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy()).when(extension).getClassLoadingStrategy();
final ClusterSingletonServiceRegistration serviceRegistration = mock(ClusterSingletonServiceRegistration.class);
doReturn(serviceRegistration).when(this.singletonServiceProvider).registerClusterSingletonService(any());
doNothing().when(serviceRegistration).close();
final DOMSchemaService schemaService = mock(DOMSchemaService.class);
doNothing().when(this.dataTreeRegistration).close();
doReturn(this.dataTreeRegistration).when(schemaService).registerSchemaContextListener(any());
final RibImpl ribImpl = new RibImpl(extension, mock(BGPDispatcher.class), this.policyProvider, mock(BindingCodecTreeFactory.class), getDomBroker(), getDataBroker(), schemaService);
doReturn(ribImpl).when(this.blueprintContainer).getComponentInstance(eq("ribImpl"));
doReturn(new BgpPeer(mock(RpcProviderRegistry.class))).when(this.blueprintContainer).getComponentInstance(eq("bgpPeer"));
this.deployer = new BgpDeployerImpl(NETWORK_INSTANCE_NAME, this.singletonServiceProvider, this.blueprintContainer, this.bundleContext, getDataBroker(), this.tableTypeRegistry);
}
Aggregations