### Question:
GeoPointTransformator extends TransformatorProcess { public void apply(String idProcess, ParameterTransformation parameterTransformation, ObjectNode jsonValue) { if (has(parameterTransformation.getKeyField(),jsonValue)) { JsonNode jsonNode = at(parameterTransformation.getKeyField(), jsonValue); if (jsonNode.isArray() && parameterTransformation.isFormatGeoJson()) { JsonNode latitude= jsonNode.get(0); JsonNode longitude =jsonNode.get(1); ArrayNode arrayNode = (ArrayNode) jsonNode; arrayNode.removeAll(); arrayNode.add(longitude); arrayNode.add(latitude); } put(jsonValue, parameterTransformation.getKeyField() + "_gp", jsonNode); remove(jsonValue,parameterTransformation.getKeyField()); } } GeoPointTransformator(); void apply(String idProcess, ParameterTransformation parameterTransformation, ObjectNode jsonValue);  }### Answer:
@Test public void should_Process_Ok() throws Exception { GeoPointTransformator geoPointTransformator = new GeoPointTransformator(); RawDataGen rd = RawDataGen.builder().messageSend("gni").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); ObjectNode jsonValue = JSONUtils.getInstance().parseObj(value); geoPointTransformator.apply(null, ParameterTransformation.builder() .keyField("messageSend") .build(), jsonValue); assertThat(jsonValue.path("messageSend_gp").asText()).isEqualTo("gni"); assertThat(jsonValue.path("messageSend").asText()).isEqualTo(""); }
@Test public void should_Process_Ko() throws Exception { GeoPointTransformator geoPointTransformator = new GeoPointTransformator(); RawDataGen rd = RawDataGen.builder().messageSend("gni").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); ObjectNode jsonValue = JSONUtils.getInstance().parseObj(value); geoPointTransformator.apply(null, ParameterTransformation.builder() .keyField("messageSend2") .build(), jsonValue); assertThat(jsonValue.path("messageSend2_gp").asText()).isEqualTo(""); }