@VisibleForTesting
    protected String buildShortMessage(Map<String, Object> fields) {
        final StringBuilder shortMessage = new StringBuilder();
        shortMessage.append("JSON API poll result: ");
        if (!flatten) {
            shortMessage.append(jsonPath.getPath());
        }
        shortMessage.append(" -> ");

        if (fields.toString().length() > 50) {
            shortMessage.append(fields.toString().substring(0, 50)).append("[...]");
        } else {
            shortMessage.append(fields.toString());
        }

        return shortMessage.toString();
    }
@Test
    public void testBuildShortMessage() throws Exception {
        Map<String, Object> fields = Maps.newLinkedHashMap();
        fields.put("baz", 9001);
        fields.put("foo", "bar");

        JsonPathCodec selector = new JsonPathCodec(configOf(CK_PATH, "$.download_count", CK_FLATTEN, false), objectMapperProvider.get(), messageFactory);
        assertThat(selector.buildShortMessage(fields)).isEqualTo("JSON API poll result: $['download_count'] -> {baz=9001, foo=bar}");
    }