@Test
  public void testPutBeingBlocked() throws Exception {
    exceptionOccurred = false;
    quitForLoop = false;
    HARegionQueueAttributes harqa = new HARegionQueueAttributes();
    harqa.setBlockingQueueCapacity(1);
    final HARegionQueue hrq = getHARegionQueueInstance(
        "BlockingHARegionJUnitTest_Region", cache, harqa, BLOCKING_HA_QUEUE, false,
        disabledClock());
    hrq.setPrimary(true);// fix for 40314 - capacity constraint is checked for primary only.
    final Thread thread1 = new DoPuts(hrq, 2);
    thread1.start();
    GeodeAwaitility.await().until(() -> hrq.region.size() == 2);
    assertTrue(thread1.isAlive()); // thread should still be alive (in wait state)

    Thread thread2 = new DoTake(hrq, 1);
    thread2.start(); // start take thread

    // sleep. take will proceed and so will sleeping put
    GeodeAwaitility.await().until(() -> hrq.region.size() == 3);

    // thread should have died since put should have proceeded
    GeodeAwaitility.await().alias("thread1 still alive").until(() -> !thread1.isAlive());

    join(thread1, 30 * 1000); // for completeness
    join(thread2, 30 * 1000);
    if (exceptionOccurred) {
      fail(" Test failed due to " + exceptionString);
    }
    cache.close();
  }
This test tests whether puts are blocked. There are two threads. One which is going to do 2
puts and one which is going to do take a single take. The capacity of the region is just 1. The
put thread is first started and it is then ensured that only one put has successfully made
through and that the thread is still alive. Then the take thread is started. This will cause
the region size to come down by one and the put thread waiting will go ahead and do the put.
The thread should then die and the region size should be validated to reflect that.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/ha/BlockingHARegionJUnitTest.java