### Question:
ValidationResultMapper { public ValidationResult mapToValidationResult(de.adorsys.psd2.xs2a.service.validator.ValidationResult xs2aValidationResult) { if (xs2aValidationResult.isValid()) { return ValidationResult.valid(); } return ValidationResult.invalid(xs2aValidationResult.getMessageError()); }  ValidationResult mapToValidationResult(de.adorsys.psd2.xs2a.service.validator.ValidationResult xs2aValidationResult); de.adorsys.psd2.xs2a.service.validator.ValidationResult mapToXs2aValidationResult(ValidationResult validationResult);  }### Answer:
@Test void mapToValidationResult_valid() { ValidationResult xs2aValidationResult = ValidationResult.valid(); de.adorsys.psd2.xs2a.core.service.validator.ValidationResult actual = validationResultMapper.mapToValidationResult(xs2aValidationResult); assertEquals(de.adorsys.psd2.xs2a.core.service.validator.ValidationResult.valid(), actual); }
@Test void mapToValidationResult_invalid_messageErrors() { MessageError messageError = new MessageError(ErrorType.AIS_400, TppMessageInformation.of(MessageErrorCode.FORMAT_ERROR)); ValidationResult xs2aValidationResult = ValidationResult.invalid(messageError); de.adorsys.psd2.xs2a.core.service.validator.ValidationResult actual = validationResultMapper.mapToValidationResult(xs2aValidationResult); assertEquals(de.adorsys.psd2.xs2a.core.service.validator.ValidationResult.invalid(messageError), actual); }
@Test void mapToValidationResult_invalid_errorTypeAndCode() { ErrorType errorType = ErrorType.AIS_400; MessageErrorCode errorCode = MessageErrorCode.FORMAT_ERROR; ValidationResult xs2aValidationResult = ValidationResult.invalid(errorType, errorCode); de.adorsys.psd2.xs2a.core.service.validator.ValidationResult actual = validationResultMapper.mapToValidationResult(xs2aValidationResult); assertEquals(de.adorsys.psd2.xs2a.core.service.validator.ValidationResult.invalid(errorType, errorCode), actual); }
@Test void mapToValidationResult_invalid_errorTypeAndTppMessageInformation() { ErrorType errorType = ErrorType.AIS_400; TppMessageInformation tppMessageInformation = TppMessageInformation.of(MessageErrorCode.FORMAT_ERROR); ValidationResult xs2aValidationResult = ValidationResult.invalid(errorType, tppMessageInformation); de.adorsys.psd2.xs2a.core.service.validator.ValidationResult actual = validationResultMapper.mapToValidationResult(xs2aValidationResult); assertEquals(de.adorsys.psd2.xs2a.core.service.validator.ValidationResult.invalid(errorType, tppMessageInformation), actual); }