BUG-7706: Fix ServiceUnavailableException
[bgpcep.git] / bgp / rib-impl / src / test / java / org / opendaylight / protocol / bgp / rib / impl / AddPathBasePathsTest.java
index 8e2d3aec08ff67115474b681a6aae613b184bc83..f2ada6e6e6f961bfd2fa390bf38b2c13f184cb59 100644 (file)
@@ -43,13 +43,12 @@ public class AddPathBasePathsTest extends AbstractAddPathTest {
             BasePathSelectionModeFactory.createBestPathSelectionStrategy());
 
         this.ribImpl = new RIBImpl(this.clusterSingletonServiceProvider, new RibId("test-rib"),
-            AS_NUMBER, new BgpId(RIB_ID), null, this.ribExtension, this.dispatcher,
+            AS_NUMBER, new BgpId(RIB_ID), null, this.ribExtension, this.serverDispatcher,
             this.mappingService.getCodecFactory(), getDomBroker(), TABLES_TYPE, pathTables,
             this.ribExtension.getClassLoadingStrategy(), null);
         this.ribImpl.instantiateServiceInstance();
         this.ribImpl.onGlobalContextUpdated(this.schemaContext);
-        final ChannelFuture channelFuture = this.dispatcher.createServer(StrictBGPPeerRegistry.GLOBAL,
-            new InetSocketAddress(RIB_ID, PORT));
+        final ChannelFuture channelFuture = this.serverDispatcher.createServer(new InetSocketAddress(RIB_ID, PORT));
         waitFutureSuccess(channelFuture);
         this.serverChannel = channelFuture.channel();
     }
@@ -73,21 +72,21 @@ public class AddPathBasePathsTest extends AbstractAddPathTest {
     public void testUseCase1() throws Exception {
         final BgpParameters nonAddPathParams = createParameter(false);
 
-        configurePeer(PEER1, this.ribImpl, nonAddPathParams, PeerRole.Ibgp);
+        configurePeer(PEER1, this.ribImpl, nonAddPathParams, PeerRole.Ibgp, this.serverRegistry);
         final BGPSessionImpl session1 = createPeerSession(PEER1, nonAddPathParams, new SimpleSessionListener());
 
-        configurePeer(PEER2, this.ribImpl, nonAddPathParams, PeerRole.Ibgp);
+        configurePeer(PEER2, this.ribImpl, nonAddPathParams, PeerRole.Ibgp, this.serverRegistry);
         final BGPSessionImpl session2 = createPeerSession(PEER2, nonAddPathParams, new SimpleSessionListener());
 
-        configurePeer(PEER3, this.ribImpl, nonAddPathParams, PeerRole.Ibgp);
+        configurePeer(PEER3, this.ribImpl, nonAddPathParams, PeerRole.Ibgp, this.serverRegistry);
         final BGPSessionImpl session3 = createPeerSession(PEER3,nonAddPathParams, new SimpleSessionListener());
 
         final SimpleSessionListener listener4 = new SimpleSessionListener();
-        configurePeer(PEER4, this.ribImpl, nonAddPathParams, PeerRole.RrClient);
+        configurePeer(PEER4, this.ribImpl, nonAddPathParams, PeerRole.RrClient, this.serverRegistry);
         final BGPSessionImpl session4 = createPeerSession(PEER4, nonAddPathParams, listener4);
 
         final SimpleSessionListener listener5 = new SimpleSessionListener();
-        configurePeer(PEER5, this.ribImpl, nonAddPathParams, PeerRole.Ebgp);
+        configurePeer(PEER5, this.ribImpl, nonAddPathParams, PeerRole.Ebgp, this.serverRegistry);
         final BGPSessionImpl session5 = createPeerSession(PEER5, nonAddPathParams, listener5);
         checkPeersPresentOnDataStore(5);
 
@@ -111,7 +110,7 @@ public class AddPathBasePathsTest extends AbstractAddPathTest {
         assertEquals(UPD_NA_200_EBGP, listener5.getListMsg().get(1));
 
         final SimpleSessionListener listener6 = new SimpleSessionListener();
-        configurePeer(PEER6, this.ribImpl, nonAddPathParams, PeerRole.RrClient);
+        configurePeer(PEER6, this.ribImpl, nonAddPathParams, PeerRole.RrClient, this.serverRegistry);
         final BGPSessionImpl session6 = createPeerSession(PEER6, nonAddPathParams, listener6);
 
         checkPeersPresentOnDataStore(6);