use of org.openkilda.wfm.topology.network.utils.SwitchOnlineStatusMonitor in project open-kilda by telstra.
the class NetworkBfdSessionServiceTest method setUp.
@Before
public void setUp() throws Exception {
RepositoryFactory repositoryFactory = Mockito.mock(RepositoryFactory.class);
when(repositoryFactory.createSwitchRepository()).thenReturn(switchRepository);
when(repositoryFactory.createBfdSessionRepository()).thenReturn(bfdSessionRepository);
when(persistenceManager.getTransactionManager()).thenReturn(transactionManager);
doAnswer(invocation -> {
TransactionCallbackWithoutResult<?> tr = invocation.getArgument(0);
tr.doInTransaction();
return null;
}).when(transactionManager).doInTransaction(Mockito.any(TransactionCallbackWithoutResult.class));
doAnswer(invocation -> {
TransactionCallback<?, ?> tr = invocation.getArgument(0);
return tr.doInTransaction();
}).when(transactionManager).doInTransaction(Mockito.any(TransactionCallback.class));
when(persistenceManager.getRepositoryFactory()).thenReturn(repositoryFactory);
switchOnlineStatusMonitor = new SwitchOnlineStatusMonitor();
endpointStatusMonitor = new EndpointStatusMonitor();
setupCarrier();
service = new NetworkBfdSessionService(persistenceManager, switchOnlineStatusMonitor, endpointStatusMonitor, carrier);
}
use of org.openkilda.wfm.topology.network.utils.SwitchOnlineStatusMonitor in project open-kilda by telstra.
the class BfdHub method init.
// -- setup --
@Override
protected void init() {
switchOnlineStatusMonitor = new SwitchOnlineStatusMonitor();
endpointStatusMonitor = new EndpointStatusMonitor();
logicalPortService = new NetworkBfdLogicalPortService(this, switchOnlineStatusMonitor, options.getBfdLogicalPortOffset());
sessionService = new NetworkBfdSessionService(persistenceManager, switchOnlineStatusMonitor, endpointStatusMonitor, this);
globalToggleService = new NetworkBfdGlobalToggleService(this, persistenceManager);
requestIdFactory = new TaskIdBasedKeyFactory(getTaskId());
}
Aggregations