@Test
  public void testOldValueInEvent() {
    // set notifyBySubscription=false to test local-invalidates
    int serverPort1 = server1.invoke(() -> new ServerBuilder()
        .regionShortcut(REPLICATE)
        .create());
    int serverPort2 = server2.invoke(() -> new ServerBuilder()
        .regionShortcut(REPLICATE)
        .create());

    client1.invoke(() -> new ClientBuilder()
        .serverPorts(serverPort1)
        .subscriptionAckInterval()
        .subscriptionEnabled(true)
        .subscriptionRedundancy()
        .create());
    client2.invoke(() -> new ClientBuilder()
        .serverPorts(serverPort2)
        .subscriptionAckInterval()
        .subscriptionEnabled(true)
        .subscriptionRedundancy()
        .create());

    client2.invoke(() -> {
      LATCH.set(new CountDownLatch(1));

      Region<String, TickerData> region = getClientCache().getRegion(regionName);
      region.getAttributesMutator()
          .addCacheListener(new ActionCacheListener<>(new Action<>(Operation.UPDATE,
              event -> {
                assertThat(event.getOldValue()).isNotNull();
                VALUE.set(event.getOldValue());
                countDown(LATCH);
              })));
      region.registerInterest("ALL_KEYS");
    });

    client1.invoke(() -> {
      LATCH.set(new CountDownLatch(1));

      Region<String, TickerData> region = getClientCache().getRegion(regionName);
      region.getAttributesMutator()
          .addCacheListener(new ActionCacheListener<>(new Action<>(Operation.UPDATE,
              event -> {
                assertThat(event.getOldValue()).isNotNull();
                VALUE.set(event.getOldValue());
                countDown(LATCH);
              })));

      // create keys
      doPutAll(region, keyPrefix, ONE_HUNDRED);
      assertThat(region.size()).isEqualTo(ONE_HUNDRED);

      // update keys
      doPutAll(region, keyPrefix, ONE_HUNDRED);
      assertThat(region.size()).isEqualTo(ONE_HUNDRED);
    });

    // the local PUTALL_UPDATE event should contain old value
    client1.invoke(() -> {
      awaitLatch(LATCH);
      assertThat(VALUE.get()).isInstanceOf(TickerData.class);
    });

    client2.invoke(() -> {
      awaitLatch(LATCH);
      assertThat(VALUE.get()).isInstanceOf(TickerData.class);
    });
  }
Tests putAll afterUpdate event contained oldValue.
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/PutAllClientServerDistributedTest.java