### Question:
CurrencyValidator { public void validateCurrency(String currency, MessageError messageError) { if (StringUtils.isEmpty(currency)) { errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_EMPTY_FIELD, CURRENCY_STRING)); } else if (!isValidCurrency(currency)) { errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(FORMAT_ERROR_WRONG_FORMAT_VALUE, CURRENCY_STRING)); } }  void validateCurrency(String currency, MessageError messageError);  }### Answer:
@Test void doValidation_success() { validator.validateCurrency(CORRECT_CURRECNY, messageError); assertTrue(messageError.getTppMessages().isEmpty()); }
@Test void doValidation_wrong() { validator.validateCurrency(WRONG_CURRENCY, messageError); assertFalse(messageError.getTppMessages().isEmpty()); assertEquals(MessageErrorCode.FORMAT_ERROR_WRONG_FORMAT_VALUE, messageError.getTppMessage().getMessageErrorCode()); assertArrayEquals(PARAMETER_TEXT, messageError.getTppMessage().getTextParameters()); }
@Test void doValidation_empty() { validator.validateCurrency(null, messageError); assertFalse(messageError.getTppMessages().isEmpty()); assertEquals(MessageErrorCode.FORMAT_ERROR_EMPTY_FIELD, messageError.getTppMessage().getMessageErrorCode()); assertArrayEquals(PARAMETER_TEXT, messageError.getTppMessage().getTextParameters()); }