From 208345c39da612595e00380467cb4cfa665225db Mon Sep 17 00:00:00 2001 From: Meher Mankikar Date: Tue, 20 Jun 2023 16:00:13 -0700 Subject: [PATCH] Consolidated error message --- .../java/software/amazon/kinesis/utils/TestConsumer.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/TestConsumer.java b/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/TestConsumer.java index 2d08ddaf..d3649952 100644 --- a/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/TestConsumer.java +++ b/amazon-kinesis-client/src/test/java/software/amazon/kinesis/utils/TestConsumer.java @@ -209,10 +209,8 @@ public class TestConsumer { private void validateRecordProcessor() throws Exception { log.info("The number of expected records is: {}", successfulPutRecords); final RecordValidationStatus errorVal = consumerConfig.getRecordValidator().validateRecords(successfulPutRecords); - if (errorVal == RecordValidationStatus.OUT_OF_ORDER) { - throw new RuntimeException("There was an error validating the records that were processed. The records were out of order"); - } else if (errorVal == RecordValidationStatus.MISSING_RECORD) { - throw new RuntimeException("There was an error validating the records that were processed. Some records were missing."); + if (errorVal != RecordValidationStatus.NO_ERROR) { + throw new RuntimeException("There was an error validating the records that were processed: " + errorVal.toString()); } log.info("--------------Completed validation of processed records.--------------"); }