@Test public void testRegisterRoleChangeListener() { final ShardTestKit testKit = new ShardTestKit(getSystem()); final TestActorRef<Shard> shard = actorFactory.createTestActor( newShardProps().withDispatcher(Dispatchers.DefaultDispatcherId()), "testRegisterRoleChangeListener"); ShardTestKit.waitUntilLeader(shard); final ActorRef listener = getSystem().actorOf(MessageCollectorActor.props()); shard.tell(new RegisterRoleChangeListener(), listener); MessageCollectorActor.expectFirstMatching(listener, RegisterRoleChangeListenerReply.class); ShardLeaderStateChanged leaderStateChanged = MessageCollectorActor.expectFirstMatching(listener, ShardLeaderStateChanged.class); assertTrue("getLocalShardDataTree present", leaderStateChanged.getLocalShardDataTree().isPresent()); assertSame("getLocalShardDataTree", shard.underlyingActor().getDataStore().getDataTree(), leaderStateChanged.getLocalShardDataTree().get()); MessageCollectorActor.clearMessages(listener); shard.tell(new RequestVote(10000, "member2", 50, 50), testKit.getRef()); leaderStateChanged = MessageCollectorActor.expectFirstMatching(listener, ShardLeaderStateChanged.class); assertFalse("getLocalShardDataTree present", leaderStateChanged.getLocalShardDataTree().isPresent()); }
@VisibleForTesting public ShardDataTree getDataStore() { return store; }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } protected  Shard(final AbstractBuilder<?, ?> builder); }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } protected  Shard(final AbstractBuilder<?, ?> builder); @Override void postStop(); int getPendingTxCommitQueueSize(); int getCohortCacheSize(); @Override @VisibleForTesting RaftActorSnapshotCohort getRaftActorSnapshotCohort(); Collection<?> convertPendingTransactionsToMessages(); @Override String persistenceId(); DatastoreContext getDatastoreContext(); @VisibleForTesting ShardDataTree getDataStore(); static Builder builder(); }
Shard extends RaftActor { @VisibleForTesting public ShardDataTree getDataStore() { return store; } protected  Shard(final AbstractBuilder<?, ?> builder); @Override void postStop(); int getPendingTxCommitQueueSize(); int getCohortCacheSize(); @Override @VisibleForTesting RaftActorSnapshotCohort getRaftActorSnapshotCohort(); Collection<?> convertPendingTransactionsToMessages(); @Override String persistenceId(); DatastoreContext getDatastoreContext(); @VisibleForTesting ShardDataTree getDataStore(); static Builder builder(); static final String DEFAULT_NAME; }