Class LocalStackContainer
java.lang.Object
org.testcontainers.containers.GenericContainer<LocalStackContainer>
org.testcontainers.containers.localstack.LocalStackContainer
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.containers.Container<LocalStackContainer>,org.testcontainers.containers.ContainerState,org.testcontainers.containers.traits.LinkableContainer,org.testcontainers.containers.wait.strategy.WaitStrategyTarget,org.testcontainers.lifecycle.Startable
@Deprecated
public class LocalStackContainer
extends org.testcontainers.containers.GenericContainer<LocalStackContainer>
Deprecated.
Testcontainers implementation for LocalStack.
Supported images: localstack/localstack, localstack/localstack-pro
Exposed ports: 4566
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDeprecated.static enumDeprecated.Nested classes/interfaces inherited from interface org.testcontainers.containers.Container
org.testcontainers.containers.Container.ExecResult -
Field Summary
FieldsFields inherited from class org.testcontainers.containers.GenericContainer
CONTAINER_RUNNING_TIMEOUT_SEC, dependencies, dockerClient, INTERNAL_HOST_HOSTNAME, waitStrategyFields inherited from interface org.testcontainers.containers.ContainerState
STATE_HEALTHY -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.useLocalStackContainer(DockerImageName)insteadLocalStackContainer(String version) Deprecated.useLocalStackContainer(DockerImageName)insteadLocalStackContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated.LocalStackContainer(org.testcontainers.utility.DockerImageName dockerImageName, boolean useLegacyMode) Deprecated.useLocalStackContainer(DockerImageName)instead -
Method Summary
Modifier and TypeMethodDescriptionprotected voidDeprecated.protected voidcontainerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Deprecated.Deprecated.Provides a default access key that is preconfigured to communicate with a given simulated service.Deprecated.Provides an endpoint to communicate with LocalStack service.Deprecated.Provides an endpoint override that is preconfigured to communicate with a given simulated service.Deprecated.Deprecated.Provides a default region that is preconfigured to communicate with a given simulated service.Deprecated.Provides a default secret key that is preconfigured to communicate with a given simulated service.withServices(LocalStackContainer.EnabledService... services) Deprecated.Declare a set of simulated AWS services that should be launched by this container.withServices(LocalStackContainer.Service... services) Deprecated.Methods inherited from class org.testcontainers.containers.GenericContainer
addEnv, addExposedPort, addExposedPorts, addFileSystemBind, addFixedExposedPort, addFixedExposedPort, addLink, canBeReused, containerIsCreated, containerIsStarted, containerIsStarted, containerIsStarting, containerIsStopped, containerIsStopping, copyFileFromContainer, createVolumeDirectory, dependsOn, dependsOn, dependsOn, doStart, equals, getBinds, getCommandParts, getContainerId, getContainerInfo, getContainerName, getCopyToFileContainerPathMap, getCreateContainerCmdModifiers, getDependencies, getDockerClient, getDockerImageName, getEnv, getEnvMap, getExposedPorts, getExtraHosts, getImage, getIpAddress, getLabels, getLinkedContainers, getLivenessCheckPort, getLivenessCheckPortNumbers, getLivenessCheckPorts, getLogConsumers, getNetwork, getNetworkAliases, getNetworkMode, getPortBindings, getShmSize, getStartupAttempts, getStartupCheckStrategy, getTestHostIpAddress, getTmpFsMapping, getVolumesFroms, getWaitStrategy, getWorkingDirectory, hashCode, isHostAccessible, isPrivilegedMode, isShouldBeReused, logger, setBinds, setCommand, setCommand, setCommandParts, setContainerDef, setCopyToFileContainerPathMap, setDockerImageName, setEnv, setExposedPorts, setExtraHosts, setHostAccessible, setImage, setLabels, setLinkedContainers, setLogConsumers, setNetwork, setNetworkAliases, setNetworkMode, setPortBindings, setPrivilegedMode, setShmSize, setStartupAttempts, setStartupCheckStrategy, setTmpFsMapping, setVolumesFroms, setWaitStrategy, setWorkingDirectory, start, stop, toString, waitingFor, waitUntilContainerStarted, withAccessToHost, withClasspathResourceMapping, withClasspathResourceMapping, withCommand, withCommand, withCopyFileToContainer, withCopyToContainer, withCreateContainerCmdModifier, withEnv, withEnv, withExposedPorts, withExtraHost, withFileSystemBind, withImagePullPolicy, withLabel, withLabels, withLogConsumer, withMinimumRunningDuration, withNetwork, withNetworkAliases, withNetworkMode, withPrivilegedMode, withReuse, withSharedMemorySize, withStartupAttempts, withStartupCheckStrategy, withStartupTimeout, withTmpFs, withVolumesFrom, withWorkingDirectoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.testcontainers.containers.Container
addFileSystemBind, followOutput, followOutput, self, withEnv, withFileSystemBindMethods inherited from interface org.testcontainers.containers.ContainerState
copyFileFromContainer, copyFileToContainer, copyFileToContainer, execInContainer, execInContainer, execInContainer, execInContainer, execInContainerWithUser, execInContainerWithUser, getBoundPortNumbers, getContainerIpAddress, getCurrentContainerInfo, getFirstMappedPort, getHost, getLogs, getLogs, getMappedPort, isCreated, isHealthy, isRunningMethods inherited from interface org.testcontainers.lifecycle.Startable
close
-
Field Details
-
VERSION
Deprecated.- See Also:
-
-
Constructor Details
-
LocalStackContainer
Deprecated.useLocalStackContainer(DockerImageName)instead -
LocalStackContainer
Deprecated.useLocalStackContainer(DockerImageName)instead -
LocalStackContainer
public LocalStackContainer(org.testcontainers.utility.DockerImageName dockerImageName) Deprecated.- Parameters:
dockerImageName- image name to use for Localstack
-
LocalStackContainer
@Deprecated public LocalStackContainer(org.testcontainers.utility.DockerImageName dockerImageName, boolean useLegacyMode) Deprecated.useLocalStackContainer(DockerImageName)instead- Parameters:
dockerImageName- image name to use for LocalstackuseLegacyMode- if true, each AWS service is exposed on a different port
-
-
Method Details
-
configure
protected void configure()Deprecated.- Overrides:
configurein classorg.testcontainers.containers.GenericContainer<LocalStackContainer>
-
containerIsStarting
protected void containerIsStarting(com.github.dockerjava.api.command.InspectContainerResponse containerInfo) Deprecated.- Overrides:
containerIsStartingin classorg.testcontainers.containers.GenericContainer<LocalStackContainer>
-
withServices
Deprecated. -
withServices
Deprecated.Declare a set of simulated AWS services that should be launched by this container.- Parameters:
services- one or more service names- Returns:
- this container object
-
getEndpointOverride
Deprecated. -
getEndpointOverride
Deprecated.Provides an endpoint override that is preconfigured to communicate with a given simulated service. The provided endpoint override should be set in the AWS Java SDK v2 when building a client, e.g.:S3Client s3 = S3Client .builder() .endpointOverride(localstack.getEndpointOverride(LocalStackContainer.Service.S3)) .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create( localstack.getAccessKey(), localstack.getSecretKey() ))) .region(Region.of(localstack.getRegion())) .build()Please note that this method is only intended to be used for configuring AWS SDK clients that are running on the test host. If other containers need to call this one, they should be configured specifically to do so using a Docker network and appropriate addressing.
- Parameters:
service- the service that is to be accessed- Returns:
- an
URIendpoint override
-
getEndpoint
Deprecated.Provides an endpoint to communicate with LocalStack service. The provided endpoint should be set in the AWS Java SDK v2 when building a client, e.g.:S3Client s3 = S3Client .builder() .endpointOverride(localstack.getEndpoint()) .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create( localstack.getAccessKey(), localstack.getSecretKey() ))) .region(Region.of(localstack.getRegion())) .build()Please note that this method is only intended to be used for configuring AWS SDK clients that are running on the test host. If other containers need to call this one, they should be configured specifically to do so using a Docker network and appropriate addressing.
- Returns:
- an
URIendpoint
-
getAccessKey
Deprecated.Provides a default access key that is preconfigured to communicate with a given simulated service. AWS Access Key The access key can be used to construct AWS SDK v2 clients:S3Client s3 = S3Client .builder() .endpointOverride(localstack.getEndpointOverride(LocalStackContainer.Service.S3)) .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create( localstack.getAccessKey(), localstack.getSecretKey() ))) .region(Region.of(localstack.getRegion())) .build()- Returns:
- a default access key
-
getSecretKey
Deprecated.Provides a default secret key that is preconfigured to communicate with a given simulated service. AWS Secret Key The secret key can be used to construct AWS SDK v2 clients:S3Client s3 = S3Client .builder() .endpointOverride(localstack.getEndpointOverride(LocalStackContainer.Service.S3)) .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create( localstack.getAccessKey(), localstack.getSecretKey() ))) .region(Region.of(localstack.getRegion())) .build()- Returns:
- a default secret key
-
getRegion
Deprecated.Provides a default region that is preconfigured to communicate with a given simulated service. The region can be used to construct AWS SDK v2 clients:S3Client s3 = S3Client .builder() .endpointOverride(localstack.getEndpointOverride(LocalStackContainer.Service.S3)) .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create( localstack.getAccessKey(), localstack.getSecretKey() ))) .region(Region.of(localstack.getRegion())) .build()- Returns:
- a default region
-
LocalStackContainerinstead.