mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 16:28:05 +01:00
Update localstack test container to 4.x
This commit is contained in:
@@ -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