Bug-7004: NPE when configuring BGP peer using OpenConfig API twice
[bgpcep.git] / bgp / rib-impl / src / test / java / org / opendaylight / protocol / bgp / rib / impl / config / BgpPeerTest.java
index 9747339c7de1ee85abb7aeedbffc2317001412d2..83a31dd26406b774aca4348a584681df2a23dabf 100644 (file)
@@ -133,6 +133,11 @@ public class BgpPeerTest extends AbstractConfig {
         Mockito.verify(this.singletonServiceRegistration, times(2)).close();
         Mockito.verify(this.serviceRegistration).unregister();
         Mockito.verify(this.future).cancel(true);
+
+        final Neighbor emptyNeighbor = new NeighborBuilder().setNeighborAddress(NEIGHBOR_ADDRESS).build();
+        this.bgpPeer.start(this.rib, emptyNeighbor, this.mappingService, this.configurationWriter);
+        assertTrue(this.bgpPeer.containsEqualConfiguration(emptyNeighbor));
+        this.bgpPeer.close();
     }
 
     static Neighbor createNeighborExpected(final IpAddress neighborAddress) {