source: class S3ArtifactStoreTest {
  
       AmazonS3Client mockClient;
       ArgumentCaptor<PutObjectRequest> putCaptor;
       ArgumentCaptor<ListObjectsRequest> listingCaptor;
  
      @Test
      public void shouldHandleBucketDoesNotExists() {
  
target:         doThrow(new RuntimeException("Bucket does not exist")).when(mockClient).listObjects(any(ListObjectsRequest.class));
          S3ArtifactStore store = new S3ArtifactStore(mockClient, "foo-bar");
          assertThat(store.bucketExists(), is(false));
      }
  
  }