@Test public void shouldRequestForkWhenNotPreviouslyLoaded() { final SafeFuture<Optional<ForkInfo>> forkRequest = new SafeFuture<>(); when(validatorApiChannel.getForkInfo()).thenReturn(forkRequest); final SafeFuture<ForkInfo> result = forkProvider.getForkInfo(); assertThat(result).isNotDone(); forkRequest.complete(Optional.of(fork)); assertThat(result).isCompletedWithValue(fork); }
public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } ForkProvider(
      final AsyncRunner asyncRunner, final ValidatorApiChannel validatorApiChannel); }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } ForkProvider(
      final AsyncRunner asyncRunner, final ValidatorApiChannel validatorApiChannel); SafeFuture<ForkInfo> getForkInfo(); SafeFuture<ForkInfo> loadForkInfo(); SafeFuture<ForkInfo> requestForkInfo(); @Override String toString(); }
ForkProvider { public SafeFuture<ForkInfo> getForkInfo() { return currentFork.map(SafeFuture::completedFuture).orElseGet(this::loadForkInfo); } ForkProvider(
      final AsyncRunner asyncRunner, final ValidatorApiChannel validatorApiChannel); SafeFuture<ForkInfo> getForkInfo(); SafeFuture<ForkInfo> loadForkInfo(); SafeFuture<ForkInfo> requestForkInfo(); @Override String toString();  }