Consolidated error message

This commit is contained in:
Meher Mankikar 2023-06-20 16:00:13 -07:00
parent d479e91add
commit 208345c39d

View file

@ -209,10 +209,8 @@ public class TestConsumer {
private void validateRecordProcessor() throws Exception { private void validateRecordProcessor() throws Exception {
log.info("The number of expected records is: {}", successfulPutRecords); log.info("The number of expected records is: {}", successfulPutRecords);
final RecordValidationStatus errorVal = consumerConfig.getRecordValidator().validateRecords(successfulPutRecords); final RecordValidationStatus errorVal = consumerConfig.getRecordValidator().validateRecords(successfulPutRecords);
if (errorVal == RecordValidationStatus.OUT_OF_ORDER) { if (errorVal != RecordValidationStatus.NO_ERROR) {
throw new RuntimeException("There was an error validating the records that were processed. The records were out of order"); throw new RuntimeException("There was an error validating the records that were processed: " + errorVal.toString());
} else if (errorVal == RecordValidationStatus.MISSING_RECORD) {
throw new RuntimeException("There was an error validating the records that were processed. Some records were missing.");
} }
log.info("--------------Completed validation of processed records.--------------"); log.info("--------------Completed validation of processed records.--------------");
} }