use of org.opendaylight.genius.mdsalutil.internal.MDSALManager in project netvirt by opendaylight.
the class ElanServiceTestModule method configureBindings.
@Override
protected void configureBindings() {
DataBroker dataBroker = DataBrokerTestModule.dataBroker();
bind(EntityOwnershipService.class).toInstance(Mockito.mock(EntityOwnershipService.class));
bind(INeutronVpnManager.class).toInstance(Mockito.mock(NeutronvpnManagerImpl.class));
IVpnManager ivpnManager = Mockito.mock(VpnManagerTestImpl.class, CALLS_REAL_METHODS);
bind(IMdsalApiManager.class).toInstance(new MDSALManager(dataBroker, Mockito.mock(PacketProcessingService.class)));
// Bindings for external services to "real" implementations
bind(LockManagerService.class).to(LockManagerServiceImpl.class);
bind(ElanConfig.class).toInstance(new ElanConfigBuilder().setIntBridgeGenMac(true).setTempSmacLearnTimeout(10).build());
// Bindings of all listeners (which are not directly referenced in the code)
// This is required to be explicit here, because these are referenced neither from src/main nor src/test
// and we, intentionally, don't use "classpath scanning for auto-discovery"
// so this list must kept, manually, in line with the rc/main/resources/org/opendaylight/blueprint/*.xml
// and target/generated-resources/org/opendaylight/blueprint/autowire.xml
// bind(ElanGroupListener.class);
// TODO complete this list!!! after Gerrit which adds @Inject to all listeners
// Bindings to test infra (fakes & mocks)
TestInterfaceManager obj = TestInterfaceManager.newInstance(dataBroker);
ItmRpcService itmRpcService = new ItmRpcTestImpl();
bind(DataBroker.class).toInstance(dataBroker);
bind(DataBroker.class).annotatedWith(OsgiService.class).toInstance(dataBroker);
bind(IdManagerService.class).toInstance(Mockito.mock(IdHelper.class, CALLS_REAL_METHODS));
bind(IInterfaceManager.class).toInstance(obj);
bind(TestInterfaceManager.class).toInstance(obj);
InterfaceMetaUtils interfaceMetaUtils = new InterfaceMetaUtils(dataBroker, Mockito.mock(IdHelper.class, CALLS_REAL_METHODS), Mockito.mock(BatchingUtils.class));
InterfaceManagerCommonUtils interfaceManagerCommonUtils = new InterfaceManagerCommonUtils(dataBroker, new MDSALManager(dataBroker, Mockito.mock(PacketProcessingService.class)), Mockito.mock(IdHelper.class, CALLS_REAL_METHODS), interfaceMetaUtils, Mockito.mock(BatchingUtils.class));
bind(OdlInterfaceRpcService.class).toInstance(ElanEgressActionsHelper.newInstance(interfaceManagerCommonUtils));
SingleTransactionDataBroker singleTransactionDataBroker = new SingleTransactionDataBroker(dataBroker);
bind(SingleTransactionDataBroker.class).toInstance(singleTransactionDataBroker);
IBgpManager ibgpManager = BgpManagerTestImpl.newInstance(singleTransactionDataBroker);
bind(ItmRpcService.class).toInstance(itmRpcService);
bind(ItmRpcTestImpl.class).toInstance((ItmRpcTestImpl) itmRpcService);
bind(DataImportBootReady.class).annotatedWith(OsgiService.class).toInstance(new DataImportBootReady() {
});
bind(DiagStatusService.class).toInstance(Mockito.mock(DiagStatusService.class));
bind(IVpnManager.class).toInstance(ivpnManager);
bind(IBgpManager.class).toInstance(ibgpManager);
bind(DataImportBootReady.class).toInstance(new DataImportBootReady() {
});
bind(IElanService.class).to(ElanServiceProvider.class);
MdsalUtils mdsalUtils = new MdsalUtils(dataBroker);
bind(MdsalUtils.class).toInstance(mdsalUtils);
bind(SouthboundUtils.class).toInstance(new SouthboundUtils(mdsalUtils));
}
Aggregations