diff --git a/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java b/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java index 49dfa38ae7..58a4be9182 100644 --- a/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java +++ b/data-prepper-plugins/s3-source/src/integrationTest/java/org/opensearch/dataprepper/plugins/source/s3/SqsWorkerIT.java @@ -312,7 +312,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks(final int numberO lenient().doAnswer((val) -> { if (val.getArgument(0) != null) { - delCount.getAndAdd((int)(double)val.getArgument(0)); + deletedCount += (double)val.getArgument(0); } return null; }).when(deletedCounter).increment(any(Double.class)); @@ -360,7 +360,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks(final int numberO await().atMost(Duration.ofSeconds(20)) .untilAsserted(() -> { assertThat(visibilityTimeoutChangedCount, greaterThanOrEqualTo((double)numberOfObjectsToWrite)); - assertThat(delCount.get(), equalTo(numberOfObjectsToWrite)); + assertThat(deletedCount, equalTo((double)numberOfObjectsToWrite)); assertThat(ackCallbackCount, equalTo((double)numberOfObjectsToWrite)); }); } @@ -387,7 +387,6 @@ void processSqsMessages_with_acks_and_progress_check_callbacks_expires(final int lenient().doAnswer((val) -> { if (val.getArgument(0) != null) { deletedCount += (double)val.getArgument(0); - delCount.getAndAdd((int)(double)val.getArgument(0)); } return null; }).when(deletedCounter).increment(any(Double.class)); @@ -429,7 +428,7 @@ void processSqsMessages_with_acks_and_progress_check_callbacks_expires(final int await().atMost(Duration.ofSeconds(10)) .untilAsserted(() -> { assertThat(visibilityTimeoutChangedCount, greaterThanOrEqualTo((double)numberOfObjectsToWrite)); - assertThat(delCount.get(), equalTo(0)); + assertThat(deletedCount, equalTo(0.0)); assertThat(ackCallbackCount, equalTo(0.0)); });