Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Chase Engelbrecht <[email protected]>
  • Loading branch information
engechas committed Aug 17, 2023
1 parent 161d310 commit 7a472d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ protected boolean retryFlushToS3(final Buffer currentBuffer, final String s3Key)
} catch (AwsServiceException | SdkClientException e) {
LOG.error("Exception occurred while uploading records to s3 bucket. Retry countdown : {} | exception:",
retryCount, e);
LOG.info("Error Massage {}", e.getMessage());
LOG.info("Error Message {}", e.getMessage());
--retryCount;
if (retryCount == 0) {
return isUploadedToS3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void test_output_with_threshold_set_as_more_then_zero_event_count() throws IOExc
S3SinkService s3SinkService = createObjectUnderTest();
assertNotNull(s3SinkService);
s3SinkService.output(generateRandomStringEventRecord());
verify(snapshotSuccessCounter, times(50)).increment();
verify(snapshotSuccessCounter, times(51)).increment();
}


Expand All @@ -216,7 +216,7 @@ void test_output_with_threshold_set_as_zero_event_count() throws IOException {
S3SinkService s3SinkService = createObjectUnderTest();
assertNotNull(s3SinkService);
s3SinkService.output(generateRandomStringEventRecord());
verify(snapshotSuccessCounter, times(50)).increment();
verify(snapshotSuccessCounter, times(51)).increment();
}

@Test
Expand All @@ -235,7 +235,7 @@ void test_output_with_uploadedToS3_success() throws IOException {
assertNotNull(s3SinkService);
assertThat(s3SinkService, instanceOf(S3SinkService.class));
s3SinkService.output(generateRandomStringEventRecord());
verify(snapshotSuccessCounter, times(50)).increment();
verify(snapshotSuccessCounter, times(51)).increment();
}

@Test
Expand All @@ -254,7 +254,7 @@ void test_output_with_uploadedToS3_success_records_byte_count() throws IOExcepti
final S3SinkService s3SinkService = createObjectUnderTest();
s3SinkService.output(generateRandomStringEventRecord());

verify(s3ObjectSizeSummary, times(50)).record(objectSize);
verify(s3ObjectSizeSummary, times(51)).record(objectSize);
}

@Test
Expand All @@ -280,7 +280,7 @@ void test_output_with_uploadedToS3_midBatch_generatesNewOutputStream() throws IO

s3SinkService.output(generateEventRecords(2));

verify(snapshotSuccessCounter, times(2)).increment();
verify(snapshotSuccessCounter, times(3)).increment();
verify(codec).writeEvent(any(), eq(outputStream1));
verify(codec).writeEvent(any(), eq(outputStream2));
}
Expand Down Expand Up @@ -318,7 +318,7 @@ void test_output_with_uploadedToS3_failure_does_not_record_byte_count() throws I
s3SinkService.output(Collections.singletonList(new Record<>(event)));

verify(s3ObjectSizeSummary, never()).record(anyLong());
verify(buffer, times(3)).flushToS3(any(), anyString(), anyString());
verify(buffer, times(6)).flushToS3(any(), anyString(), anyString());
}

@Test
Expand Down

0 comments on commit 7a472d5

Please sign in to comment.