### Question:
FieldExistValidator extends ValidatorProcess { public ValidateData process(ProcessValidation processValidation, JsonNode jsonValue) { if (has(processValidation.getParameterValidation().getFieldExist(),jsonValue)) { return ValidateData.builder() .success(true) .typeValidation(TypeValidation.FIELD_EXIST) .jsonValue(jsonValue) .build(); } else { return ValidateData.builder() .success(false) .statusCode(StatusCode.field_not_exist) .typeValidation(TypeValidation.MAX_FIELD) .message("Field " + processValidation.getParameterValidation().getFieldExist() + " is not present") .jsonValue(jsonValue) .build(); } } FieldExistValidator(); ValidateData process(ProcessValidation processValidation, JsonNode jsonValue);  }### Answer:
@Test public void should_Process_Ok() throws Exception { FieldExistValidator fieldExistValidator = new FieldExistValidator(); RawDataGen rd = RawDataGen.builder().messageSend("gni").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); JsonNode jsonValue = JSONUtils.getInstance().parse(value); ValidateData v = fieldExistValidator.process(ProcessValidation.builder() .parameterValidation(ParameterValidation.builder() .fieldExist("messageSend") .build() ).build(), jsonValue); assertThat(v.success).isTrue(); }
@Test public void should_Process_Ko() throws Exception { FieldExistValidator fieldExistValidator = new FieldExistValidator(); RawDataGen rd = RawDataGen.builder().messageSend("gni").project("project").type("type").build(); ObjectMapper obj = new ObjectMapper(); String value = obj.writeValueAsString(rd); JsonNode jsonValue = JSONUtils.getInstance().parse(value); ValidateData v = fieldExistValidator.process(ProcessValidation.builder() .parameterValidation(ParameterValidation.builder() .fieldExist("toto") .build() ).build(), jsonValue); assertThat(v.success).isFalse(); }