@Test
    public void testWrongPartitions() {
        assertCommandThrows(AdminOperationException.class, "{\"version\":1}");
        assertCommandThrows(JsonProcessingException.class, "{\"partitions\":2}");
        assertCommandThrows(JsonProcessingException.class, "{\"partitions\":{}}");
        assertCommandThrows(JsonProcessingException.class, "{\"partitions\":[{}]}");
        assertCommandThrows(JsonProcessingException.class, "{\"partitions\":[{\"topic\":\"t\"}]}");
        assertCommandThrows(JsonProcessingException.class, "{\"partitions\":[{\"topic\":\"t\", \"partition\": \"\"}]}");
        assertCommandThrows(JsonProcessingException.class, "{\"partitions\":[{\"topic\":\"t\", \"partition\": 0}]}");
        assertCommandThrows(JsonProcessingException.class, "{\"partitions\":[{\"topic\":\"t\", \"offset\":0}]}");
    }
Unit test of {@link DeleteRecordsCommand} tool.
tools/src/test/java/org/apache/kafka/tools/DeleteRecordsCommandTest.java