Class S3MockStarter

java.lang.Object
com.adobe.testing.s3mock.testsupport.common.S3MockStarter

public abstract class S3MockStarter extends Object
Helps configuring and starting the S3Mock app and provides a configured client for it.
  • Field Details

  • Constructor Details

  • Method Details

    • defaultProps

      protected Map<String,Object> defaultProps()
    • createS3ClientV2

      public software.amazon.awssdk.services.s3.S3Client createS3ClientV2()
      Creates an S3Client client instance that is configured to call the started S3Mock server using HTTPS.
      Returns:
      The S3Client instance.
    • createS3Client

      public com.amazonaws.services.s3.AmazonS3 createS3Client()
      Creates an AmazonS3 client instance that is configured to call the started S3Mock server using HTTPS.
      Returns:
      The AmazonS3 instance.
    • createS3Client

      public com.amazonaws.services.s3.AmazonS3 createS3Client(String region)
      Creates an AmazonS3 client instance that is configured to call the started S3Mock server using HTTPS for a given region.
      Parameters:
      region - Region to define regional endpoint.
      Returns:
      The AmazonS3 instance.
    • getPort

      public int getPort()
    • getHttpPort

      public int getHttpPort()
    • registerKMSKeyRef

      public void registerKMSKeyRef(String keyRef)
      Registers a valid KMS key reference in the mock server.
      Parameters:
      keyRef - A KMS Key Reference
    • configureClientToIgnoreInvalidSslCertificates

      public com.amazonaws.ClientConfiguration configureClientToIgnoreInvalidSslCertificates(com.amazonaws.ClientConfiguration clientConfiguration)
      Adjusts the given client configuration to allow the communication with the mock server using HTTPS, although that one uses a self-signed SSL certificate.
      Parameters:
      clientConfiguration - The ClientConfiguration to adjust.
      Returns:
      The adjusted instance.
    • getEndpointConfiguration

      protected com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration getEndpointConfiguration(String region)
    • getServiceEndpoint

      public String getServiceEndpoint()
      Returns endpoint URL for connecting to the mock server.
      Returns:
      endpoint URL for connecting to the mock server.
    • start

      protected void start()
    • stop

      protected void stop()