ListGcsObjects { public static void listGcsObjects( String googleAccessKeyId, String googleAccessKeySecret, String bucketName) { BasicAWSCredentials googleCreds = new BasicAWSCredentials(googleAccessKeyId, googleAccessKeySecret); AmazonS3 interopClient = AmazonS3ClientBuilder.standard() .withEndpointConfiguration( new AwsClientBuilder.EndpointConfiguration( "https: .withCredentials(new AWSStaticCredentialsProvider(googleCreds)) .build(); ObjectListing objects = interopClient.listObjects(bucketName); System.out.println("Objects:"); for (S3ObjectSummary object : objects.getObjectSummaries()) { System.out.println(object.getKey()); } interopClient.shutdown(); }  static void listGcsObjects(
      String googleAccessKeyId, String googleAccessKeySecret, String bucketName);  }
@Test public void testListObjects() throws Exception { ListGcsObjects.listGcsObjects(KEY_ID, SECRET_KEY, BUCKET); String output = bout.toString(); assertThat(output, CoreMatchers.containsString("Objects:")); }