### Question:
LongFieldTransformator extends TransformatorProcess { public void apply(String idProcess, ParameterTransformation parameterTransformation, ObjectNode jsonValue) { String valueToFormat = at(parameterTransformation.getKeyField(), jsonValue).asText(); if (StringUtils.isNotBlank(valueToFormat)) { put(jsonValue, parameterTransformation.getKeyField() + "_long", Long.valueOf(valueToFormat)); remove(jsonValue,parameterTransformation.getKeyField()); } } LongFieldTransformator(); void apply(String idProcess, ParameterTransformation parameterTransformation, ObjectNode jsonValue);  }### Answer:
@Test public void should_Process_Ok() throws Exception { LongFieldTransformator longFieldTransformator = new LongFieldTransformator(); RawDataGen rd = RawDataGen.builder().messageSend("1548").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); ObjectNode jsonValue = JSONUtils.getInstance().parseObj(value); longFieldTransformator.apply(null, ParameterTransformation.builder() .keyField("messageSend") .build(), jsonValue); assertThat(jsonValue.path("messageSend_long").asLong()).isEqualTo(new Long(1548)); assertThat(jsonValue.path("messageSend").asText()).isEqualTo(""); }
@Test public void should_Process_Ko() throws Exception { LongFieldTransformator longFieldTransformator = new LongFieldTransformator(); RawDataGen rd = RawDataGen.builder().messageSend("1548").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); ObjectNode jsonValue = JSONUtils.getInstance().parseObj(value); longFieldTransformator.apply(null, ParameterTransformation.builder() .keyField("messageSend2") .build(), jsonValue); assertThat(jsonValue.path("messageSend2_long").asText()).isEqualTo(""); }