Class S3MockStarter
java.lang.Object
com.adobe.testing.s3mock.testsupport.common.S3MockStarter
Helps configuring and starting the S3Mock app and provides a configured client for it.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.amazonaws.ClientConfigurationconfigureClientToIgnoreInvalidSslCertificates(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.com.amazonaws.services.s3.AmazonS3Creates anAmazonS3client instance that is configured to call the started S3Mock server using HTTPS.com.amazonaws.services.s3.AmazonS3createS3Client(String region) Creates anAmazonS3client instance that is configured to call the started S3Mock server using HTTPS for a given region.software.amazon.awssdk.services.s3.S3ClientCreates anS3Clientclient instance that is configured to call the started S3Mock server using HTTPS.protected com.amazonaws.client.builder.AwsClientBuilder.EndpointConfigurationgetEndpointConfiguration(String region) intintgetPort()Returns endpoint URL for connecting to the mock server.voidregisterKMSKeyRef(String keyRef) Registers a valid KMS key reference in the mock server.protected voidstart()protected voidstop()
-
Field Details
-
s3MockFileStore
-
properties
-
-
Constructor Details
-
S3MockStarter
-
-
Method Details
-
defaultProps
-
createS3ClientV2
public software.amazon.awssdk.services.s3.S3Client createS3ClientV2()Creates anS3Clientclient instance that is configured to call the started S3Mock server using HTTPS.- Returns:
- The
S3Clientinstance.
-
createS3Client
public com.amazonaws.services.s3.AmazonS3 createS3Client()Creates anAmazonS3client instance that is configured to call the started S3Mock server using HTTPS.- Returns:
- The
AmazonS3instance.
-
createS3Client
Creates anAmazonS3client 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
AmazonS3instance.
-
getPort
public int getPort() -
getHttpPort
public int getHttpPort() -
registerKMSKeyRef
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- TheClientConfigurationto adjust.- Returns:
- The adjusted instance.
-
getEndpointConfiguration
protected com.amazonaws.client.builder.AwsClientBuilder.EndpointConfiguration getEndpointConfiguration(String region) -
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()
-