### Question:
BulkPaymentTypeValidatorImpl extends SinglePaymentTypeValidatorImpl { void doBulkValidation(BulkPayment bulkPayment, MessageError messageError, PaymentValidationConfig validationConfig) { if (bulkPayment.getDebtorAccount() == null) { errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(MessageErrorCode.FORMAT_ERROR_NULL_VALUE, "debtorAccount")); } else { validateAccount(bulkPayment.getDebtorAccount(), messageError, validationConfig); } List<SinglePayment> payments = bulkPayment.getPayments(); if (CollectionUtils.isEmpty(payments)) { errorBuildingService.enrichMessageError(messageError, TppMessageInformation.of(MessageErrorCode.FORMAT_ERROR_BULK)); } else { payments.forEach(singlePayment -> super.doSingleValidation(singlePayment, messageError, validationConfig)); } if (isDateInThePast(bulkPayment.getRequestedExecutionDate())) { errorBuildingService.enrichMessageError( messageError, TppMessageInformation.of(MessageErrorCode.EXECUTION_DATE_INVALID_IN_THE_PAST)); } } @Autowired  BulkPaymentTypeValidatorImpl(ErrorBuildingService errorBuildingService, Xs2aObjectMapper xs2aObjectMapper,
                                        PaymentMapper paymentMapper, AmountValidator amountValidator,
                                        IbanValidator ibanValidator); @Override PaymentType getPaymentType(); @Override MessageError validate(Object body, MessageError messageError, PaymentValidationConfig validationConfig);  }### Answer:
@Test void doBulkValidation_success() { validator.doBulkValidation(bulkPayment, messageError, validationConfig); assertTrue(messageError.getTppMessages().isEmpty()); }
@Test void doValidation_bulkDebtorAccount_null_error() { bulkPayment.setDebtorAccount(null); validator.doBulkValidation(bulkPayment, messageError, validationConfig); assertEquals(MessageErrorCode.FORMAT_ERROR_NULL_VALUE, messageError.getTppMessage().getMessageErrorCode()); assertArrayEquals(new Object[]{"debtorAccount"}, messageError.getTppMessage().getTextParameters()); }
@Test void doValidation_bulkPayments_null_error() { bulkPayment.setPayments(Collections.emptyList()); validator.doBulkValidation(bulkPayment, messageError, validationConfig); assertEquals(MessageErrorCode.FORMAT_ERROR_BULK, messageError.getTppMessage().getMessageErrorCode()); }
@Test void doValidation_bulkDateInThePast_error() { bulkPayment.setRequestedExecutionDate(LocalDate.MIN); validator.doBulkValidation(bulkPayment, messageError, validationConfig); assertEquals(MessageErrorCode.EXECUTION_DATE_INVALID_IN_THE_PAST, messageError.getTppMessage().getMessageErrorCode()); }
@Test void doBulkValidation_remittanceInformationStructuredArray_reference_error() { singlePayment.setRemittanceInformationStructuredArray(Collections.singletonList(VALUE_141_LENGTH)); validator.doBulkValidation(bulkPayment, messageError, validationConfig); assertEquals(MessageErrorCode.FORMAT_ERROR_OVERSIZE_FIELD, messageError.getTppMessage().getMessageErrorCode()); assertArrayEquals(new Object[]{"remittanceInformationStructured", 140}, messageError.getTppMessage().getTextParameters()); }