Untitled
vas
plain_text
10 months ago
660 B
5
Indexable
@Test
void delete_shouldReturnTrue_whenFileIsDeletedSuccessfully() throws FileDownloadException {
// Arrange
when(awsS3ClientBuilderService.createAwsS3Client(any(), any(), any())).thenReturn(s3Client);
when(s3Client.listObjectsV2(any(String.class))).thenReturn(new ListObjectsV2Result());
// Act
boolean result = fileMgmtService.delete(AppTestConstants.BUCKET, AppTestConstants.FILENAME);
// Assert
assertTrue(result);
verify(s3Client, times(1)).deleteObject(AppTestConstants.BUCKET, AppTestConstants.FILENAME);
verify(awsS3ClientBuilderService, times(1)).shutdown(s3Client);
}Editor is loading...
Leave a Comment