@Test
  public void testStartStopStartDurableClientUpdate() {
    startupDurableClientAndServer(VERY_LONG_DURABLE_TIMEOUT_SECONDS);
    // Have the durable client register interest in all keys
    registerInterest(durableClientVM, regionName, true, InterestResultPolicy.NONE);

    // Start normal publisher client
    publisherClientVM.invoke(() -> createCacheClient(
        getClientPool(NetworkUtils.getServerHostName(), server1Port,
            false),
        regionName));

    // Publish some entries
    publishEntries(publisherClientVM, 0, 1);

    // Verify the durable client received the updates
    checkListenerEvents(1, 1, -1, durableClientVM);

    server1VM.invoke("wait for client acknowledgement", () -> {
      CacheClientProxy proxy = getClientProxy();
      await().untilAsserted(
          () -> assertThat(proxy._messageDispatcher._messageQueue.stats.getEventsRemoved())
              .isGreaterThan(0));
    });

    // Stop the durable client
    disconnectDurableClient(true);

    // Verify the durable client still exists on the server
    server1VM.invoke(DurableClientTestBase::waitForCacheClientProxyPaused);

    // Publish some entries
    publishEntries(publisherClientVM, 1, 1);

    // Verify the durable client's queue contains the entries
    server1VM.invoke("Verify durable client", new CacheSerializableRunnable() {
      @Override
      public void run2() throws CacheException {
        CacheClientProxy proxy = getClientProxy();
        assertThat(proxy).isNotNull();
        // Verify the queue size
        assertThat(proxy.getQueueSize()).isEqualTo(1);
      }
    });

    // Verify that disconnected client does not receive any events.
    verifyListenerUpdatesDisconnected(1);

    // Re-start the durable client
    restartDurableClient(DistributionConfig.DEFAULT_DURABLE_CLIENT_TIMEOUT, true);

    // Verify durable client on server
    verifyDurableClientPresent(DistributionConfig.DEFAULT_DURABLE_CLIENT_TIMEOUT, durableClientId,
        server1VM);

    // Verify the durable client received the updates held for it on the server
    checkListenerEvents(1, 1, -1, durableClientVM);

    // Stop the publisher client
    publisherClientVM.invoke((SerializableRunnableIF) CacheServerTestUtil::closeCache);

    // Stop the durable client VM
    durableClientVM.invoke((SerializableRunnableIF) CacheServerTestUtil::closeCache);

    // Stop the server
    server1VM.invoke((SerializableRunnableIF) CacheServerTestUtil::closeCache);
  }
Test that a durable client correctly receives updates after it reconnects.
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientTestCase.java