@Test
  public void testDurableCQServerFailoverWithoutHAConfigured()
      throws Exception {
    String greaterThan5Query = "select * from " + SEPARATOR + regionName + " p where p.ID > 5";
    String allQuery = "select * from " + SEPARATOR + regionName + " p where p.ID > -1";
    String lessThan5Query = "select * from " + SEPARATOR + regionName + " p where p.ID < 5";

    // Start a server 1
    server1Port = server1VM
        .invoke(() -> createCacheServer(regionName, true));

    // Start server 2
    server2Port = server2VM.invoke(() -> createCacheServer(regionName, true));

    // Start a durable client that is kept alive on the server when it stops normally
    durableClientId = getName() + "_client";
    createCacheClient(
        getClientPool(VM.getHostName(), server1Port, server2Port, true, 0),
        regionName, getClientDistributedSystemProperties(durableClientId), true);

    // register non durable cq
    createCq("GreaterThan5", greaterThan5Query, false).execute();

    // register durable cqs
    createCq("All", allQuery, true).execute();
    createCq("LessThan5", lessThan5Query, true).execute();

    // send client ready
    getClientCache().readyForEvents();

    int oldPrimaryPort = getPrimaryServerPort();
    // Close the server that is hosting subscription queue
    VM primary = getPrimaryServerVM();
    // Verify durable client on server
    verifyDurableClientPresent(DistributionConfig.DEFAULT_DURABLE_CLIENT_TIMEOUT, durableClientId,
        primary);

    primary.invoke((SerializableRunnableIF) CacheServerTestUtil::closeCache);

    // Wait until failover to the another server is successfully performed
    waitForFailoverToPerform(oldPrimaryPort);
    primary = getPrimaryServerVM();
    waitForDurableClientPresence(durableClientId, primary);
    int primaryPort = getPrimaryServerPort();

    // Stop the durable client
    CacheServerTestUtil.closeCache(true);

    // Start normal publisher client
    startClient(publisherClientVM, primaryPort, regionName);

    // Publish some entries
    publishEntries(publisherClientVM, regionName, 10);

    // Restart the durable client
    createCacheClient(
        getClientPool(VM.getHostName(), primaryPort, true),
        regionName, getClientDistributedSystemProperties(durableClientId), true);
    assertThat(getClientCache()).isNotNull();

    // Re-register non durable cq
    createCq("GreaterThan5", greaterThan5Query, false).execute();

    // Re-register durable cqs
    createCq("All", allQuery, true).execute();
    createCq("LessThan5", lessThan5Query, true).execute();

    // send client ready
    getClientCache().readyForEvents();

    // verify cq events for all 3 cqs
    checkCqListenerEvents("GreaterThan5", 0 /* numEventsExpected */,
        /* numEventsToWaitFor */ 15/* secondsToWait */);
    checkCqListenerEvents("LessThan5", 5 /* numEventsExpected */,
        /* numEventsToWaitFor */ 15/* secondsToWait */);
    checkCqListenerEvents("All", 10 /* numEventsExpected */,
        /* numEventsToWaitFor */ 15/* secondsToWait */);

    primary = getPrimaryServerVM();
    // Stop the durable client
    CacheServerTestUtil.closeCache(false);
    // Stop the publisher client
    publisherClientVM.invoke((SerializableRunnableIF) CacheServerTestUtil::closeCache);
    // Stop the remaining server
    primary.invoke((SerializableRunnableIF) CacheServerTestUtil::closeCache);
  }
Test that durable CQ is correctly re-registered to new server after the failover and
that the durable client functionality works as expected.
Steps:
1. Start two servers
2. Start durable client without HA and register durable CQs
3. Shutdown the server that is hosting CQs subscription queue (primary server)
4. Wait for the durable client to perform the failover to the another server
5. Shutdown the durable client with keepAlive flag set to true
6. Provision remaining server with the data that should fulfil CQ condition and fill the queue
7. Start the durable client again and check that it receives correct events from queue
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/DurableClientCQDUnitTest.java