@Override
  public void waitTilFullyReconnected() {
    try {
      await().until(() -> {
        InternalDistributedSystem internalDistributedSystem =
            InternalDistributedSystem.getConnectedInstance();
        return internalDistributedSystem != null
            && internalDistributedSystem.getCache() != null
            && !internalDistributedSystem.getCache().getCacheServers().isEmpty();
      });

    } catch (Exception e) {
      // provide more information when condition is not satisfied after awaitility timeout
      InternalDistributedSystem ids = InternalDistributedSystem.getConnectedInstance();
      System.out.println("ds is: " + (ids != null ? "not null" : "null"));
      System.out.println("cache is: " + (ids.getCache() != null ? "not null" : "null"));
      System.out.println("has cache server: "
          + (!ids.getCache().getCacheServers().isEmpty()));
      throw e;
    }
    InternalDistributedSystem dm = InternalDistributedSystem.getConnectedInstance();
    cache = dm.getCache();
  }
This is a rule to start up a server in your current VM. It's useful for your Integration Tests.

<p>
This rules allows you to create/start a server using any @ConfigurationProperties, you can chain
the configuration of the rule like this: ServerStarterRule server = new ServerStarterRule()
.withProperty(key, value) .withName(name) .withProperties(properties) .withSecurityManager(class)
.withJmxManager() .withRestService() .withEmbeddedLocator() .withRegion(type, name) etc, etc. If
your rule calls withAutoStart(), the cache and server will be started before your test code.

<p>
In your test code, you can use the rule to access the server's attributes, like the port
information, working dir, name, and the cache and cacheServer it creates.

<p>
If you need a rule to start a server/locator in different VMs for Distributed tests, You should
use {@code ClusterStartupRule}.
geode-dunit/src/main/java/org/apache/geode/test/junit/rules/ServerStarterRule.java