import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doReturn;
shard.tell(FindLeader.INSTANCE, getRef());
final FindLeaderReply findLeadeReply =
expectMsgClass(duration("5 seconds"), FindLeaderReply.class);
- assertNull("Expected the shard not to be the leader", findLeadeReply.getLeaderActor());
+ assertFalse("Expected the shard not to be the leader", findLeadeReply.getLeaderActor().isPresent());
// Signal the onChangeListenerRegistered latch to tell the thread above to proceed
// with the election process.
shard.tell(FindLeader.INSTANCE, getRef());
final FindLeaderReply findLeadeReply =
expectMsgClass(duration("5 seconds"), FindLeaderReply.class);
- assertNull("Expected the shard not to be the leader", findLeadeReply.getLeaderActor());
+ assertFalse("Expected the shard not to be the leader", findLeadeReply.getLeaderActor().isPresent());
writeToStore(shard, path, ImmutableNodes.containerNode(TestModel.TEST_QNAME));