@Test
    public void testJsonMetadataPrettyPrintOutput() throws Exception {
        String json = getParamOutContent("--json", "-r", resourcePrefix + "testJsonMultipleInts.html");

        assertTrue(json.contains("\"X-TIKA:Parsed-By\" : [ \"org.apache.tika.parser.DefaultParser\", " + "\"org.apache.tika.parser.html.JSoupParser\" ],"));
        //test pretty-print alphabetic sort of keys
        int enc = json.indexOf("\"Content-Encoding\"");
        int fb = json.indexOf("fb:admins");
        int title = json.indexOf("\"dc:title\"");
        assertTrue(enc > -1 && fb > -1 && enc < fb);
        assertTrue(fb > -1 && title > -1 && fb > title);
    }
Test for -json with prettyprint option

@throws Exception
tika-app/src/test/java/org/apache/tika/cli/TikaCLITest.java