Class S3Mock

  • Direct Known Subclasses:
    S3ClassExtension

    public class S3Mock
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      S3Mock​(java.util.List<java.lang.String> buckets, java.util.List<MockObject> mockObjects)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.amazonaws.services.s3.AmazonS3 getClient()
      Creates a client to manipulate the object storage during tests.
      java.lang.String getEndpoint()
      Returns the URL to the S3 Mock endpoint.
      int getPort()
      Returns the port where to S3 Mock is listening on.
      void resetAll()
      Clears all buckets and objects from the store.
      protected void shutdown()  
      protected void start()  
      protected void stop()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • S3Mock

        public S3Mock​(java.util.List<java.lang.String> buckets,
                      java.util.List<MockObject> mockObjects)
    • Method Detail

      • start

        protected void start()
      • stop

        protected void stop()
      • shutdown

        protected void shutdown()
      • getEndpoint

        public java.lang.String getEndpoint()
        Returns the URL to the S3 Mock endpoint.
        Returns:
        A full URL containing scheme, host and port.
      • getPort

        public int getPort()
        Returns the port where to S3 Mock is listening on.
        Returns:
        The random port.
      • resetAll

        public void resetAll()
        Clears all buckets and objects from the store. Afterwards restores all buckets and object specified during creation.
      • getClient

        public com.amazonaws.services.s3.AmazonS3 getClient()
        Creates a client to manipulate the object storage during tests.
        Returns:
        get the client from the AWS SDK