### Question:
PsuIPAddressHeaderValidatorImpl extends AbstractHeaderValidatorImpl implements PaymentHeaderValidator, ConsentHeaderValidator { @Override protected String getHeaderName() { return PSU_IP_ADDRESS; } @Autowired  PsuIPAddressHeaderValidatorImpl(ErrorBuildingService errorBuildingService);   }### Answer:
@Test void validate_success() { headers.put(validator.getHeaderName(), CORRECT_IP_ADDRESS); validator.validate(headers, messageError); assertTrue(messageError.getTppMessages().isEmpty()); }
@Test void validate_ipAddressV6_success() { headers.put(validator.getHeaderName(), CORRECT_V6_IP_ADDRESS); validator.validate(headers, messageError); assertTrue(messageError.getTppMessages().isEmpty()); }
@Test void validate_nullHeader_error() { headers.put(validator.getHeaderName(), null); validator.validate(headers, messageError); assertEquals(MessageErrorCode.FORMAT_ERROR_NULL_HEADER, messageError.getTppMessage().getMessageErrorCode()); assertArrayEquals(PSU_IP_ADDRESS_HEADER_NAME, messageError.getTppMessage().getTextParameters()); }
@Test void validate_blankHeader_error() { headers.put(validator.getHeaderName(), ""); validator.validate(headers, messageError); assertEquals(MessageErrorCode.FORMAT_ERROR_BLANK_HEADER, messageError.getTppMessage().getMessageErrorCode()); assertArrayEquals(PSU_IP_ADDRESS_HEADER_NAME, messageError.getTppMessage().getTextParameters()); }
@Test void validate_ipAddress_error() { headers.put(validator.getHeaderName(), WRONG_IP_ADDRESS); validator.validate(headers, messageError); assertEquals(MessageErrorCode.FORMAT_ERROR_WRONG_IP_ADDRESS, messageError.getTppMessage().getMessageErrorCode()); }
@Test void validate_ipAddressV6_error() { headers.put(validator.getHeaderName(), WRONG_V6_IP_ADDRESS); validator.validate(headers, messageError); assertEquals(MessageErrorCode.FORMAT_ERROR_WRONG_IP_ADDRESS, messageError.getTppMessage().getMessageErrorCode()); }