private void verifyMetadata() {
    Region region = cache.getRegion(PartitionedRegionName);
    ClientMetadataService cms = ((GemFireCacheImpl) cache).getClientMetadataService();
    cms.getClientPRMetadata((LocalRegion) region);

    await().until(cms::isMetadataStable);

    await().until(() -> cms.getClientPRMetadata_TEST_ONLY().size() > 0);

    final Map<String, ClientPartitionAdvisor> regionMetaData = cms.getClientPRMetadata_TEST_ONLY();
    assertThat(regionMetaData).containsKey(region.getFullPath());

    await().until(() -> {
      ClientPartitionAdvisor prMetaData = regionMetaData.get(region.getFullPath());
      assertThat(prMetaData).isNotNull();
      assertThat(prMetaData.adviseRandomServerLocation()).isNotNull();
      return true;
    });
  }
If a client doesn't know the primary location of a bucket it should perform a
metadata refresh. This test purposefully removes all primary location knowledge
from PR metadata in a client cache and then performs a bulk operation. This
should trigger a refresh.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/SingleHopGetAllPutAllDUnitTest.java