use of org.openkilda.persistence.repositories.BfdSessionRepository in project open-kilda by telstra.
the class NetworkBfdSessionServiceTest method surviveOffline.
@Test
public void surviveOffline() {
// offline
switchOnlineStatusMonitor.update(alphaLogicalEndpoint.getDatapath(), false);
doAnswer(invocation -> invocation.getArgument(0)).when(bfdSessionRepository).add(any());
mockSwitchLookup(alphaSwitch);
mockSwitchLookup(betaSwitch);
mockMissingBfdSession(alphaLogicalEndpoint);
service.enableUpdate(alphaLogicalEndpoint, alphaEndpoint.getPortNumber(), new BfdSessionData(alphaToBetaIslRef, genericBfdProperties));
verifyNoMoreInteractions(carrier);
// online
switchOnlineStatusMonitor.update(alphaLogicalEndpoint.getDatapath(), true);
// ensure we react on enable requests
verify(carrier).sendWorkerBfdSessionCreateRequest(argThat(argument -> argument.getTarget().getDatapath().equals(alphaLogicalEndpoint.getDatapath()) && argument.getRemote().getDatapath().equals(betaEndpoint.getDatapath())));
verifyNoMoreInteractions(carrier);
}
Aggregations