Class S3MockApplication

java.lang.Object
com.adobe.testing.s3mock.S3MockApplication

@SpringBootApplication(exclude=org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, excludeName="org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration") public class S3MockApplication extends Object
File Store Application that mocks Amazon S3.
  • Field Details

    • DEFAULT_HTTPS_PORT

      public static final int DEFAULT_HTTPS_PORT
      See Also:
    • DEFAULT_HTTP_PORT

      public static final int DEFAULT_HTTP_PORT
      See Also:
    • RANDOM_PORT

      public static final int RANDOM_PORT
      See Also:
    • DEFAULT_SERVER_SSL_KEY_STORE

      public static final String DEFAULT_SERVER_SSL_KEY_STORE
      See Also:
    • DEFAULT_SERVER_SSL_KEY_STORE_PASSWORD

      public static final String DEFAULT_SERVER_SSL_KEY_STORE_PASSWORD
      See Also:
    • DEFAULT_SERVER_SSL_KEY_ALIAS

      public static final String DEFAULT_SERVER_SSL_KEY_ALIAS
      See Also:
    • DEFAULT_SERVER_SSL_KEY_PASSWORD

      public static final String DEFAULT_SERVER_SSL_KEY_PASSWORD
      See Also:
    • PROP_INITIAL_BUCKETS

      public static final String PROP_INITIAL_BUCKETS
      Property name for passing a comma separated list of buckets that are to be created at startup.
      See Also:
    • PROP_ROOT_DIRECTORY

      public static final String PROP_ROOT_DIRECTORY
      Property name for passing a root directory to use. If omitted a default temp-dir will be used.
      See Also:
    • PROP_HTTPS_PORT

      public static final String PROP_HTTPS_PORT
      Property name for passing the HTTPS port to use. Defaults to 9191. If set to 0, a random port will be chosen.
      See Also:
    • PROP_HTTP_PORT

      public static final String PROP_HTTP_PORT
      Property name for passing the HTTP port to use. Defaults to 9090. If set to 0, a random port will be chosen.
      See Also:
    • SERVER_SSL_KEY_STORE

      public static final String SERVER_SSL_KEY_STORE
      Property name for passing the path to the keystore to use. Defaults to "classpath:s3mock.jks".
      See Also:
    • SERVER_SSL_KEY_STORE_PASSWORD

      public static final String SERVER_SSL_KEY_STORE_PASSWORD
      Property name for passing the password for the keystore. Defaults to "password".
      See Also:
    • SERVER_SSL_KEY_ALIAS

      public static final String SERVER_SSL_KEY_ALIAS
      Property name for specifying the key to use. Defaults to "selfsigned".
      See Also:
    • SERVER_SSL_KEY_PASSWORD

      public static final String SERVER_SSL_KEY_PASSWORD
      Property name for passing the password for the key. Defaults to "password".
      See Also:
    • PROP_SECURE_CONNECTION

      public static final String PROP_SECURE_CONNECTION
      Property name for using either HTTPS or HTTP connections.
      See Also:
    • PROP_SILENT

      public static final String PROP_SILENT
      Property name for enabling the silent mode with logging set at WARN and without banner.
      See Also:
  • Constructor Details

    • S3MockApplication

      public S3MockApplication()
  • Method Details

    • main

      public static void main(String[] args)
      Main Class that starts the server using start(String...).
      Parameters:
      args - Default command args.
    • start

      public static S3MockApplication start(String... args)
      Starts the server.
      Parameters:
      args - in program args format, e.g. "--server.port=0".
      Returns:
      the S3MockApplication
    • start

      public static S3MockApplication start(Map<String,Object> properties, String... args)
      Starts the server.
      Parameters:
      properties - properties to pass to the application in key-value format.
      args - in program args format, e.g. "--server.port=0".
      Returns:
      the S3MockApplication
    • stop

      public void stop()
      Stops the server.
    • getPort

      @Deprecated public int getPort()
      Deprecated.
      Using the S3Mock directly through Java is discouraged. Either run the JAR and start a separate JVM, or run the Docker container.
      Gets the Https server port.
      Returns:
      Https server port.
    • getHttpPort

      @Deprecated public int getHttpPort()
      Deprecated.
      Using the S3Mock directly through Java is discouraged. Either run the JAR and start a separate JVM, or run the Docker container.
      Gets the Http server port.
      Returns:
      Http server port.
    • registerKMSKeyRef

      @Deprecated public void registerKMSKeyRef(String keyRef)
      Deprecated.
      Using the S3Mock directly through Java is discouraged. Either run the JAR and start a separate JVM, or run the Docker container.
      Registers a valid KMS key reference on the mock server.
      Parameters:
      keyRef - A KMS Key Reference