Class S3TestCredentials


  • public class S3TestCredentials
    extends Object
    Access to credentials to access S3 buckets during integration tests.
    • Constructor Detail

      • S3TestCredentials

        public S3TestCredentials()
    • Method Detail

      • assumeCredentialsAvailable

        public static void assumeCredentialsAvailable()
        Checks whether credentials are available in the environment variables of this JVM. If not, throws an AssumptionViolatedException which causes JUnit tests to be skipped.
      • getS3AccessKey

        public static String getS3AccessKey()
        Gets the S3 Access Key.

        This method throws an exception if the key is not available. Tests should use assumeCredentialsAvailable() to skip tests when credentials are not available.

      • getS3SecretKey

        public static String getS3SecretKey()
        Gets the S3 Secret Key.

        This method throws an exception if the key is not available. Tests should use assumeCredentialsAvailable() to skip tests when credentials are not available.

      • getTestBucketUri

        public static String getTestBucketUri()
        Gets the URI for the path under which all tests should put their data.

        This method throws an exception if the bucket was not configured. Tests should use assumeCredentialsAvailable() to skip tests when credentials are not available.

      • getTestBucketUriWithScheme

        public static String getTestBucketUriWithScheme​(String scheme)
        Gets the URI for the path under which all tests should put their data.

        This method throws an exception if the bucket was not configured. Tests should use assumeCredentialsAvailable() to skip tests when credentials are not available.