Annotation Type LocalstackDockerProperties


@Retention(RUNTIME)
@Target(TYPE)
@Inherited
public @interface LocalstackDockerProperties
An annotation to provide parameters to the main (Docker-based) LocalstackTestRunner
  • Optional Element Summary

    Optional Elements 
    Modifier and Type Optional Element Description
    java.lang.Class<? extends IBindMountProvider> bindMountProvider
    Used for injecting directories or files that are bind mounted into the docker container.
    java.lang.Class<? extends IEnvironmentVariableProvider> environmentVariableProvider
    Used for injecting environment variables into the container.
    java.lang.Class<? extends IHostNameResolver> hostNameResolver
    Used for determining the host name of the machine running the docker containers so that the containers can be addressed.
    boolean ignoreDockerRunErrors
    Determines if errors should be ignored when starting the Docker container.
    java.lang.String imageName
    Use a specific image name (consisting of organisation and repository, e.g.
    java.lang.String imageTag
    Use a specific image tag for docker container
    java.lang.String initializationToken
    A Java Regex that is used to wait for the execution of custom init scripts
    java.lang.String platform
    Specifies a target platform for the localstack docker image.
    java.lang.String portEdge
    Port number for the edge service, the main entry point for all API invocations.
    java.lang.String portElasticSearch
    Port number for the elasticsearch service.
    boolean pullNewImage
    Determines if a new image is pulled from the docker repo before the tests are run.
    boolean randomizePorts
    Deprecated.
    java.lang.String[] services
    Determines which services should be run when the localstack starts.
    boolean useSingleDockerContainer
    Determines if the singleton container should be used by all test classes
  • Element Details

    • hostNameResolver

      java.lang.Class<? extends IHostNameResolver> hostNameResolver
      Used for determining the host name of the machine running the docker containers so that the containers can be addressed.
      Default:
      cloud.localstack.docker.annotation.LocalHostNameResolver.class
    • environmentVariableProvider

      java.lang.Class<? extends IEnvironmentVariableProvider> environmentVariableProvider
      Used for injecting environment variables into the container. Implement a class that provides a map of the environment variables and they will be injected into the container on start-up
      Default:
      cloud.localstack.docker.annotation.DefaultEnvironmentVariableProvider.class
    • bindMountProvider

      java.lang.Class<? extends IBindMountProvider> bindMountProvider
      Used for injecting directories or files that are bind mounted into the docker container. Implement a class that provides a map of host to container directory or file mappings, with host directories/files as keys and container directories/files as values. Remember that Docker needs absolute paths for host directories and files.
      Default:
      cloud.localstack.docker.annotation.IBindMountProvider.EmptyBindMountProvider.class
    • initializationToken

      java.lang.String initializationToken
      A Java Regex that is used to wait for the execution of custom init scripts
      Default:
      ""
    • pullNewImage

      boolean pullNewImage
      Determines if a new image is pulled from the docker repo before the tests are run.
      Default:
      false
    • randomizePorts

      @Deprecated boolean randomizePorts
      Deprecated.
      Determines if the container should expose the default local stack ports (4567-4583) or if it should expose randomized ports in order to prevent conflicts with other localstack containers running on the same machine. Deprecated, since latest LocalStack is using a single entry point (edge service)
      Default:
      false
    • services

      java.lang.String[] services
      Determines which services should be run when the localstack starts. When empty, all the services available get up and running.
      See Also:
      ServiceName
      Default:
      {}
    • imageName

      java.lang.String imageName
      Use a specific image name (consisting of organisation and repository, e.g. localstack/localstack-full for docker container
      Default:
      ""
    • imageTag

      java.lang.String imageTag
      Use a specific image tag for docker container
      Default:
      ""
    • portEdge

      java.lang.String portEdge
      Port number for the edge service, the main entry point for all API invocations. Alternatively, use the LOCALSTACK_EDGE_PORT environment variable.
      Default:
      "4566"
    • portElasticSearch

      java.lang.String portElasticSearch
      Port number for the elasticsearch service. Alternatively, use the LOCALSTACK_ELASTICSEARCH_PORT environment variable.
      Default:
      "4571"
    • useSingleDockerContainer

      boolean useSingleDockerContainer
      Determines if the singleton container should be used by all test classes
      Default:
      false
    • ignoreDockerRunErrors

      boolean ignoreDockerRunErrors
      Determines if errors should be ignored when starting the Docker container. This can be used to run tests with an existing LocalStack container running on the host.
      Default:
      false
    • platform

      java.lang.String platform
      Specifies a target platform for the localstack docker image. Value is used by the --platform flag in the docker run command
      Default:
      ""