### Question:
HashFieldTransformator extends TransformatorProcess { public void apply(String idProcess, ParameterTransformation parameterTransformation, ObjectNode jsonValue) { JsonNode valueField = at(parameterTransformation.getProcessHashData().getField(), jsonValue); if(valueField != null && StringUtils.isNotBlank(valueField.asText())){ switch (parameterTransformation.getProcessHashData().getTypeHash()){ case SHA256: HashFunction m_hash256 = Hashing.sha256(); String valueHash256 = m_hash256.hashBytes(valueField.asText().getBytes()).toString(); put(jsonValue, parameterTransformation.getProcessHashData().getField(), valueHash256); break; case MURMUR3: HashFunction m_hashMurmur3 = Hashing.murmur3_128(); String valueHashMurmur3 = m_hashMurmur3.hashBytes(valueField.asText().getBytes()).toString(); put(jsonValue, parameterTransformation.getProcessHashData().getField(), valueHashMurmur3); break; default: log.error("Type Hash not manage {}",parameterTransformation.getProcessHashData().getTypeHash()); break; } } } HashFieldTransformator(); void apply(String idProcess, ParameterTransformation parameterTransformation, ObjectNode jsonValue);  }### Answer:
@Test public void should_Process_Ok() throws Exception { HashFieldTransformator hashFieldTransformator = new HashFieldTransformator(); RawDataGen rd = RawDataGen.builder().messageSend("message gni de test").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); ObjectNode jsonValue = JSONUtils.getInstance().parseObj(value); hashFieldTransformator.apply(null, ParameterTransformation.builder() .processHashData(ProcessHashData.builder() .field("messageSend") .typeHash(TypeHash.MURMUR3) .build() ).build(), jsonValue); assertThat(jsonValue.path("messageSend").asText()).isEqualTo("7dd5a4ac398698f085e216e25a330f58"); }
@Test public void should_Process_Ko() throws Exception { HashFieldTransformator hashFieldTransformator = new HashFieldTransformator(); RawDataGen rd = RawDataGen.builder().messageSend("").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); ObjectNode jsonValue = JSONUtils.getInstance().parseObj(value); hashFieldTransformator.apply(null, ParameterTransformation.builder() .processHashData(ProcessHashData.builder() .field("messageSend") .typeHash(TypeHash.MURMUR3) .build() ).build(), jsonValue); assertThat(jsonValue.path("messageSend").asText()).isEqualTo(""); }