コード例 #1
0
  /** Tests a corner case, when there is no BGP speakers in the configuration. */
  @Test
  public void testNullBgpSpeakers() {
    reset(bgpConfig);
    expect(bgpConfig.bgpSpeakers()).andReturn(Collections.emptySet()).anyTimes();
    replay(bgpConfig);

    // We don't expect any intents in this case
    reset(intentSynchronizer);
    replay(intentSynchronizer);
    peerConnectivityManager.start();
    verify(intentSynchronizer);
  }
コード例 #2
0
  /** Initializes peer connectivity testing environment. */
  private void initPeerConnectivity() {
    expect(bgpConfig.bgpSpeakers()).andReturn(bgpSpeakers).anyTimes();
    replay(bgpConfig);
    expect(networkConfigService.getConfig(APPID, BgpConfig.class)).andReturn(bgpConfig).anyTimes();
    replay(networkConfigService);
    replay(interfaceService);

    intentSynchronizer = createMock(IntentSynchronizationService.class);
    replay(intentSynchronizer);

    peerConnectivityManager =
        new PeerConnectivityManager(
            APPID, intentSynchronizer, networkConfigService, CONFIG_APP_ID, interfaceService);
  }