@BeforeClass
public static void setup() throws InterruptedException {
- Thread.sleep(1000);//give some time for previous test to stop the system. Netty port conflict arises otherwise.
system = ActorSystem.create("opendaylight-rpc", ConfigFactory.load().getConfig("unit-test"));
system.actorOf(Props.create(TerminationMonitor.class), "termination-monitor");
@Test
public void testReceiveGossipTick_WhenNoRemoteMemberShouldIgnore(){
- mockGossiper.setClusterMembers(Collections.EMPTY_LIST);
+ mockGossiper.setClusterMembers(Collections.<Address>emptyList());
doNothing().when(mockGossiper).getLocalStatusAndSendTo(any(Address.class));
mockGossiper.receiveGossipTick();
verify(mockGossiper, times(0)).getLocalStatusAndSendTo(any(Address.class));
verify(mockGossiper, times(0)).updateRemoteBuckets(anyMap());
}
- @Test
- public void testUpdateRemoteBuckets_WhenNoBucketShouldIgnore(){
-
- mockGossiper.updateRemoteBuckets(null);
- verify(mockGossiper, times(0)).getContext();
-
- Map<Address, Bucket> empty = Collections.emptyMap();
- mockGossiper.updateRemoteBuckets(empty);
- verify(mockGossiper, times(0)).getContext();
- }
-
/**
* Create Gossiper actor and return the underlying instance of Gossiper class.
*