@Test
  public void startWaitsForStartupTasksToComplete() {
    ServerLauncherCacheProvider cacheProvider = mock(ServerLauncherCacheProvider.class);
    InternalResourceManager internalResourceManager = mock(InternalResourceManager.class);
    InternalCache cacheFromBuilder = createCache(internalResourceManager);
    CompletableFuture<Void> startupTasks = spy(new CompletableFuture<>());
    when(cacheProvider.createCache(any(), any()))
        .thenReturn(cacheFromBuilder);
    when(internalResourceManager.allOfStartupTasks())
        .thenReturn(startupTasks);

    ServerLauncher serverLauncher = new Builder()
        .setControllableProcessFactory(() -> mock(ControllableProcess.class))
        .setDisableDefaultServer(true)
        .setServerLauncherCacheProvider(cacheProvider)
        .build();

    CompletableFuture<Void> serverLauncherStart = CompletableFuture.runAsync(serverLauncher::start);

    await().untilAsserted(() -> verify(startupTasks).thenRun(any()));
    assertThat(serverLauncherStart).isNotDone();

    startupTasks.complete(null);

    await().untilAsserted(() -> assertThat(serverLauncherStart).isDone());
  }
Unit tests for {@link ServerLauncher}.

@since GemFire 7.0
geode-core/src/test/java/org/apache/geode/distributed/ServerLauncherTest.java