- public void testWaitTillReadyCountDown(){
- final DistributedDataStore distributedDataStore = new DistributedDataStore(actorContext);
- doReturn(datastoreContext).when(actorContext).getDatastoreContext();
- doReturn(shardElectionTimeout).when(datastoreContext).getShardLeaderElectionTimeout();
- doReturn(FiniteDuration.apply(5000, TimeUnit.MILLISECONDS)).when(shardElectionTimeout).duration();
+ public void testWaitTillReadyCountDown() {
+ try (DistributedDataStore distributedDataStore = new DistributedDataStore(actorUtils, UNKNOWN_ID)) {
+ doReturn(datastoreContext).when(actorUtils).getDatastoreContext();
+ doReturn(shardElectionTimeout).when(datastoreContext).getShardLeaderElectionTimeout();
+ doReturn(FiniteDuration.apply(5000, TimeUnit.MILLISECONDS)).when(shardElectionTimeout).duration();