mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 16:56:53 +00:00
Update localstack test container to 4.x
This commit is contained in:
1 parent
5f77d7f582
commit
83d19ac8ed
2 files changed
+11
-3
No files matched your search
+10
-2
@@ -7,6 +7,7 @@ package org.whispersystems.textsecuregcm.storage;
|
||||
|
||||
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.jupiter.api.extension.AfterAllCallback;
|
||||
import org.junit.jupiter.api.extension.AfterEachCallback;
|
||||
import org.junit.jupiter.api.extension.BeforeAllCallback;
|
||||
@@ -31,9 +32,16 @@ import software.amazon.awssdk.services.s3.model.ListObjectsV2Request;
|
||||
public class S3LocalStackExtension implements BeforeEachCallback, AfterEachCallback, BeforeAllCallback,
|
||||
AfterAllCallback {
|
||||
|
||||
private final static DockerImageName LOCAL_STACK_IMAGE = DockerImageName.parse(TestcontainersImages.getLocalStack());
|
||||
private final static DockerImageName LOCAL_STACK_IMAGE = DockerImageName.parse(TestcontainersImages.getLocalStack())
|
||||
.asCompatibleSubstituteFor(
|
||||
// Workaround: DockerImageName#parse does not correctly handle registry/image:tag@sha256:hash,
|
||||
// and so it doesn't consider the image to be "localstack/localstack"
|
||||
StringUtils.substringBefore(
|
||||
StringUtils.substringBefore(TestcontainersImages.getLocalStack(), "@"),
|
||||
":"));
|
||||
|
||||
private static LocalStackContainer LOCAL_STACK = new LocalStackContainer(LOCAL_STACK_IMAGE).withServices(S3);
|
||||
private static LocalStackContainer LOCAL_STACK = new LocalStackContainer(LOCAL_STACK_IMAGE).withServices(S3)
|
||||
.withExposedPorts(4566);
|
||||
|
||||
private final String bucketName;
|
||||
private S3AsyncClient s3Client;
|
||||
|
||||
Reference in new issue
Block a user