@Test
  public void testJsonEmptyRPFormatter() throws Exception {
    WMFullResourcePlan fullRp = createRP("test_rp_1", null, null);
    formatter.showFullResourcePlan(out, fullRp);
    out.flush();

    ObjectMapper objectMapper = new ObjectMapper();
    JsonNode jsonTree = objectMapper.readTree(bos.toByteArray());

    assertNotNull(jsonTree);
    assertTrue(jsonTree.isObject());
    assertEquals("test_rp_1", jsonTree.get("name").asText());
    assertTrue(jsonTree.get("parallelism").isNull());
    assertTrue(jsonTree.get("defaultPool").isNull());
    assertTrue(jsonTree.get("pools").isArray());
    assertEquals(0, jsonTree.get("pools").size());
  }
Test class for json resource plan formatter.
ql/src/test/org/apache/hadoop/hive/ql/metadata/formatting/TestJsonRPFormatter.java