public static void createClientCache(String host, Integer port1, Integer port2) throws Exception {
    PORT1 = port1;
    PORT2 = port2;
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");
    new EventIDVerificationDUnitTest().createCache(props);
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.DISTRIBUTED_ACK);
    factory.setMirrorType(MirrorType.NONE);

    ClientServerTestCase.configureConnectionPool(factory, host, new int[] {PORT1, PORT2}, true, -1,
        2, null, -1, -1, -2);


    CacheWriter writer = new CacheWriterAdapter() {
      @Override
      public void beforeCreate(EntryEvent event) {
        EventID eventId = ((EntryEventImpl) event).getEventId();
        vm0.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        vm1.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        try {
          super.beforeCreate(event);
        } catch (CacheWriterException e) {
          e.printStackTrace();
          fail("Test failed bcoz of exception =" + e);
        }
      }


      @Override
      public void beforeUpdate(EntryEvent event) {

        EventID eventId = ((EntryEventImpl) event).getEventId();
        vm0.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        vm1.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        try {
          super.beforeUpdate(event);
        } catch (CacheWriterException e) {
          e.printStackTrace();
          fail("Test failed bcoz of exception =" + e);
        }

      }

      @Override
      public void beforeDestroy(EntryEvent event) {
        EventID eventId = ((EntryEventImpl) event).getEventId();
        vm0.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        vm1.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        try {
          super.beforeDestroy(event);
        } catch (CacheWriterException e) {
          e.printStackTrace();
          fail("Test failed bcoz of exception =" + e);
        }

      }

      @Override
      public void beforeRegionDestroy(RegionEvent event) {
        EventID eventId = ((RegionEventImpl) event).getEventId();
        vm0.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        vm1.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        try {
          super.beforeRegionDestroy(event);
        } catch (CacheWriterException e) {
          e.printStackTrace();
          fail("Test failed bcoz of exception =" + e);
        }

      }

      @Override
      public void beforeRegionClear(RegionEvent event) {
        EventID eventId = ((RegionEventImpl) event).getEventId();
        vm0.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        vm1.invoke(() -> EventIDVerificationDUnitTest.setEventIDData(eventId));
        try {
          super.beforeRegionClear(event);
        } catch (CacheWriterException e) {
          e.printStackTrace();
          fail("Test failed bcoz of exception =" + e);
        }
      }
    };
    factory.setCacheWriter(writer);
    /*
     * factory.setCacheListener(new CacheListenerAdapter() { public void afterCreate(EntryEvent
     * event) { synchronized (this) { threadId = ((EntryEventImpl)event).getEventId().getThreadID();
     * membershipId = ((EntryEventImpl)event).getEventId().getMembershipID(); } }
     *
     * public void afterUpdate(EntryEvent event) { synchronized (this) { verifyEventIDs(event); } }
     *
     * public void afterDestroy(EntryEvent event) { synchronized (this) { verifyEventIDs(event); } }
     * public void afterRegionDestroy(RegionEvent event) { synchronized (this) { threadId =
     * ((RegionEventImpl)event).getEventId().getThreadID(); membershipId =
     * ((RegionEventImpl)event).getEventId().getMembershipID(); } } });
     */

    RegionAttributes attrs = factory.create();
    Region r = cache.createRegion(REGION_NAME, attrs);
    r.registerInterest("ALL_KEYS");
  }
Verify that EventId is prapogated to server in case of region clear. It also checks that peer
nodes also get the same EventID.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/EventIDVerificationDUnitTest.java