diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/AbstractAws1ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/AbstractAws1ClientIT.java new file mode 100644 index 0000000000..0d1fba6cf6 --- /dev/null +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/AbstractAws1ClientIT.java @@ -0,0 +1,12 @@ +package co.elastic.apm.agent.awssdk.v1; + +import co.elastic.apm.agent.awssdk.common.AbstractAwsClientIT; + +public abstract class AbstractAws1ClientIT extends AbstractAwsClientIT { + + public static final String LOCALSTACK_VERSION = "0.14.2"; + + public AbstractAws1ClientIT() { + super(LOCALSTACK_VERSION); + } +} diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java index 59afe20f2e..1ebe829184 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/DynamoDbClientIT.java @@ -50,7 +50,7 @@ import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; -public class DynamoDbClientIT extends AbstractAwsClientIT { +public class DynamoDbClientIT extends AbstractAws1ClientIT { private AmazonDynamoDB dynamoDB; private AmazonDynamoDBAsync dynamoDBAsync; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java index 7ef95379a7..05a6f1e282 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/S3ClientIT.java @@ -36,7 +36,7 @@ import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3; -public class S3ClientIT extends AbstractAwsClientIT { +public class S3ClientIT extends AbstractAws1ClientIT { private AmazonS3 s3; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java index e811db0ac4..7efb851088 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSClientIT.java @@ -57,6 +57,10 @@ public class SQSClientIT extends AbstractSQSClientIT { CoreConfiguration coreConfiguration; MessagingConfiguration messagingConfiguration; + public SQSClientIT() { + super(AbstractAws1ClientIT.LOCALSTACK_VERSION); + } + @BeforeEach public void setupClient() { coreConfiguration = tracer.getConfig(CoreConfiguration.class); diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java index 2b871bc11f..f8a2ebe393 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-1-plugin/src/test/java/co/elastic/apm/agent/awssdk/v1/SQSJmsClientIT.java @@ -56,7 +56,7 @@ import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; import static org.mockito.Mockito.doReturn; -public class SQSJmsClientIT extends AbstractAwsClientIT { +public class SQSJmsClientIT extends AbstractAws1ClientIT { AmazonSQSMessagingClientWrapper client; SQSConnection connection; SQSConnection receivingConnection; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml index 3e65036a3b..6025ce3407 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/pom.xml @@ -13,7 +13,7 @@ ${project.basedir}/../../.. - 2.21.13 + 2.21.36 2.0.0 8 diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/AbstractAws2ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/AbstractAws2ClientIT.java new file mode 100644 index 0000000000..b0162779c1 --- /dev/null +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/AbstractAws2ClientIT.java @@ -0,0 +1,12 @@ +package co.elastic.apm.agent.awssdk.v2; + +import co.elastic.apm.agent.awssdk.common.AbstractAwsClientIT; + +public abstract class AbstractAws2ClientIT extends AbstractAwsClientIT { + + public static final String LOCALSTACK_VERSION = "3.0.2"; + + public AbstractAws2ClientIT() { + super(LOCALSTACK_VERSION); + } +} diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java index dcd5a2e1b5..6e9c6b7f29 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/DynamoDbClientIT.java @@ -54,7 +54,7 @@ import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; -public class DynamoDbClientIT extends AbstractAwsClientIT { +public class DynamoDbClientIT extends AbstractAws2ClientIT { private DynamoDbClient dynamoDB; private DynamoDbAsyncClient dynamoDBAsync; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java index 2eba149de9..5b369a396d 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/S3ClientIT.java @@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat; -public class S3ClientIT extends AbstractAwsClientIT { +public class S3ClientIT extends AbstractAws2ClientIT { private S3Client s3; private S3AsyncClient s3Async; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java index 992bb5460d..da977bb9aa 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSClientIT.java @@ -60,6 +60,10 @@ public class SQSClientIT extends AbstractSQSClientIT { CoreConfiguration coreConfiguration; MessagingConfiguration messagingConfiguration; + public SQSClientIT() { + super(AbstractAws2ClientIT.LOCALSTACK_VERSION); + } + @BeforeEach public void setupClient() { coreConfiguration = tracer.getConfig(CoreConfiguration.class); diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java index 86124494d9..3286c10644 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-2-plugin/src/test/java/co/elastic/apm/agent/awssdk/v2/SQSJmsClientIT.java @@ -57,7 +57,7 @@ import static org.mockito.Mockito.doReturn; import static co.elastic.apm.agent.testutils.assertions.Assertions.assertThat; -public class SQSJmsClientIT extends AbstractAwsClientIT { +public class SQSJmsClientIT extends AbstractAws2ClientIT { AmazonSQSMessagingClientWrapper client; SQSConnection connection; SQSConnection receivingConnection; diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java index 9a935eb7b6..622d56be20 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractAwsClientIT.java @@ -40,7 +40,6 @@ @Testcontainers public abstract class AbstractAwsClientIT extends AbstractInstrumentationTest { - private static final DockerImageName localstackImage = DockerImageName.parse("localstack/localstack:0.14.2"); protected static final String BUCKET_NAME = "some-test-bucket"; protected static final String SQS_QUEUE_NAME = "some-test-sqs-queue"; protected static final String SQS_IGNORED_QUEUE_NAME = "ignored-queue"; @@ -52,7 +51,12 @@ public abstract class AbstractAwsClientIT extends AbstractInstrumentationTest { protected static final String KEY_CONDITION_EXPRESSION = "attributeOne = :one"; @Container - protected LocalStackContainer localstack = new LocalStackContainer(localstackImage).withServices(localstackService()); + protected LocalStackContainer localstack; + + public AbstractAwsClientIT(String localstackVersion) { + DockerImageName localstackImage = DockerImageName.parse("localstack/localstack:" + localstackVersion); + localstack = new LocalStackContainer(localstackImage).withServices(localstackService()); + } protected abstract String awsService(); diff --git a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java index 48005464f3..dd8368ed51 100644 --- a/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java +++ b/apm-agent-plugins/apm-aws-sdk/apm-aws-sdk-common/src/test/java/co/elastic/apm/agent/awssdk/common/AbstractSQSClientIT.java @@ -38,6 +38,10 @@ public abstract class AbstractSQSClientIT extends AbstractAwsClientIT { protected CoreConfiguration coreConfiguration; protected MessagingConfiguration messagingConfiguration; + public AbstractSQSClientIT(String localstackVersion) { + super(localstackVersion); + } + @BeforeEach public void setupConfig() { coreConfiguration = tracer.getConfig(CoreConfiguration.class);