### Question:
QueryConverter extends StringValueConverter<Query> { @Override public Query convertToModel(String id, Map<String, Object> jsonMap) throws IOException { Query q = new Query(); q.setName(id); updateValue(q, jsonMap); return q; }  @Override String getId(Query jpaEntity); @Override String getEntityIdFieldName(); @Override String getValue(Query jpaEntity); @Override void setValue(Query jpaEntity, String value); @Override Query convertToModel(String id, Map<String, Object> jsonMap);  }### Answer:
@Test public void convertToModel() throws IOException { QueryConverter converter = new QueryConverter(); Map<String, Object> data = new HashMap<String, Object>(); data.put("template", "{\"query\":{\"match_all\":{}}}"); Query p = converter.convertToModel("matchAllQuery", data); assertEquals("matchAllQuery", p.getName()); TestUtils.assertJsonContent("{\"template\":\"{\\\"query\\\":{\\\"match_all\\\":{}}}\"}", p.getValue()); }