@Test public void optimizeQueryNonSVG() { CypherHttpMessageConverter cypherHttpMessageConverter = new CypherHttpMessageConverter(); Stream<MediaType> nonSvg = cypherHttpMessageConverter .getSupportedMediaTypes() .stream() .filter(x -> !x.getSubtype().contains("svg+xml")); nonSvg.forEach(x -> { CypherQuery cypherQuery = CypherHttpMessageConverter .optimizeQueryForType(new CypherQuery("bla bal LIMIT 10"), new ResultFormatterFactory().create(x)); assertThat(cypherQuery.getQuery(), Is.is ("bla bal LIMIT 10")); }); }
static CypherQuery optimizeQueryForType(CypherQuery cypherQuery, ResultFormatter formatter) { if (formatter instanceof ResultFormatterSVG) { cypherQuery = attemptQueryRewrite(cypherQuery, " LIMIT "); cypherQuery = attemptQueryRewrite(cypherQuery, " limit "); } return cypherQuery; }
CypherHttpMessageConverter extends AbstractHttpMessageConverter<CypherQuery> { static CypherQuery optimizeQueryForType(CypherQuery cypherQuery, ResultFormatter formatter) { if (formatter instanceof ResultFormatterSVG) { cypherQuery = attemptQueryRewrite(cypherQuery, " LIMIT "); cypherQuery = attemptQueryRewrite(cypherQuery, " limit "); } return cypherQuery; } }
CypherHttpMessageConverter extends AbstractHttpMessageConverter<CypherQuery> { static CypherQuery optimizeQueryForType(CypherQuery cypherQuery, ResultFormatter formatter) { if (formatter instanceof ResultFormatterSVG) { cypherQuery = attemptQueryRewrite(cypherQuery, " LIMIT "); cypherQuery = attemptQueryRewrite(cypherQuery, " limit "); } return cypherQuery; } CypherHttpMessageConverter(); }
CypherHttpMessageConverter extends AbstractHttpMessageConverter<CypherQuery> { static CypherQuery optimizeQueryForType(CypherQuery cypherQuery, ResultFormatter formatter) { if (formatter instanceof ResultFormatterSVG) { cypherQuery = attemptQueryRewrite(cypherQuery, " LIMIT "); cypherQuery = attemptQueryRewrite(cypherQuery, " limit "); } return cypherQuery; } CypherHttpMessageConverter();  }
CypherHttpMessageConverter extends AbstractHttpMessageConverter<CypherQuery> { static CypherQuery optimizeQueryForType(CypherQuery cypherQuery, ResultFormatter formatter) { if (formatter instanceof ResultFormatterSVG) { cypherQuery = attemptQueryRewrite(cypherQuery, " LIMIT "); cypherQuery = attemptQueryRewrite(cypherQuery, " limit "); } return cypherQuery; } CypherHttpMessageConverter();   }