@Test
  public void namedQuery() throws Exception {
    // Declare the named query
    String namedQuery = "SELECT c FROM " + SEPARATOR + "customers c WHERE c.customerId = $1";

    // Install the named query
    assertResponse(
        restClient.doPost("/queries?id=selectCustomer&q=" + URLEncoder.encode(namedQuery, "UTF-8"),
            "dataReader", "1234567", ""))
                .hasStatusCode(201);

    // Verify the query has been installed
    String query = "/queries";
    assertResponse(restClient.doGet(query, "dataReader", "1234567"))
        .hasStatusCode(200)
        .hasContentType(APPLICATION_JSON_UTF8_VALUE);

    // Execute the query
    JsonNode jsonArray =
        assertResponse(restClient.doPost("/queries/selectCustomer", "dataReader", "1234567",
            "{" + "\"@type\": \"int\"," + "\"@value\": 1" + "}"))
                .hasStatusCode(200)
                .getJsonObject();

    assertEquals(1, jsonArray.size());
    JsonNode customer = jsonArray.get(0);
    assertEquals("*********", customer.get("ssn").asText());
    assertEquals(1L, customer.get("id").asLong());
  }
Test post-processing of a retrieved key from the server.
geode-assembly/src/integrationTest/java/org/apache/geode/rest/internal/web/RestSecurityPostProcessorTest.java