@Test
  public void testResponseNonExistentRegion() {
    System.out.println(
        "ClusterSelectedRegionsMemberServiceTest ::  ------TESTCASE BEGIN : NON-EXISTENT REGION CHECK FOR CLUSTER REGION MEMBERS------");
    if (httpclient != null) {
      try {
        System.out.println("Test for non-existent region : " + SEPARATOR + "Rubbish");
        HttpUriRequest pulseupdate = RequestBuilder.post().setUri(new URI(PULSE_UPDATE_URL))
            .addParameter(PULSE_UPDATE_PARAM, PULSE_UPDATE_4_VALUE).build();
        try (CloseableHttpResponse response = httpclient.execute(pulseupdate)) {
          HttpEntity entity = response.getEntity();

          System.out.println("ClusterSelectedRegionsMemberServiceTest :: HTTP request status : "
              + response.getStatusLine());

          BufferedReader respReader =
              new BufferedReader(new InputStreamReader(entity.getContent()));
          StringWriter sw = new StringWriter();
          PrintWriter pw = new PrintWriter(sw);
          String sz;
          while ((sz = respReader.readLine()) != null) {
            pw.print(sz);
          }
          String jsonResp = sw.getBuffer().toString();
          System.out.println(
              "ClusterSelectedRegionsMemberServiceTest :: JSON response returned : " + jsonResp);
          EntityUtils.consume(entity);

          JSONObject jsonObj = new JSONObject(jsonResp);
          JSONObject clusterSelectedRegionObj =
              jsonObj.getJSONObject("ClusterSelectedRegionsMember");
          Assert.assertNotNull(
              "ClusterSelectedRegionsMemberServiceTest :: Server returned null for ClusterSelectedRegionsMember",
              clusterSelectedRegionObj);
          JSONObject jsonObjRegion =
              clusterSelectedRegionObj.getJSONObject("selectedRegionsMembers");
          Assert.assertNotNull(
              "ClusterSelectedRegionsMemberServiceTest :: Server returned null for selectedRegionsMembers",
              jsonObjRegion);
          Assert.assertTrue(
              "ClusterSelectedRegionsMemberServiceTest :: Server did not return error on non-existent region",
              jsonObjRegion.has("errorOnRegion"));
        }
      } catch (Exception failed) {
        logException(failed);
        Assert.fail("Exception ! ");
      }
    } else {
      Assert.fail("ClusterSelectedRegionsMemberServiceTest :: No Http connection was established.");
    }
    System.out.println(
        "ClusterSelectedRegionsMemberServiceTest ::  ------TESTCASE END : NON-EXISTENT REGION CHECK FOR CLUSTER REGION MEMBERS------");
  }
Tests that response is for same region
geode-pulse/src/uiTest/java/org/apache/geode/tools/pulse/tests/junit/ClusterSelectedRegionsMemberServiceTest.java