Remove latest dep limit for aws2 sqs test (#9902)
This commit is contained in:
parent
e148b84536
commit
9d65926094
|
@ -84,9 +84,6 @@ dependencies {
|
||||||
testLibrary("software.amazon.awssdk:sqs:2.2.0")
|
testLibrary("software.amazon.awssdk:sqs:2.2.0")
|
||||||
testLibrary("software.amazon.awssdk:sns:2.2.0")
|
testLibrary("software.amazon.awssdk:sns:2.2.0")
|
||||||
testLibrary("software.amazon.awssdk:ses:2.2.0")
|
testLibrary("software.amazon.awssdk:ses:2.2.0")
|
||||||
|
|
||||||
// last version that does not use json protocol
|
|
||||||
latestDepTestLibrary("software.amazon.awssdk:sqs:2.21.17")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val latestDepTest = findProperty("testLatestDeps") as Boolean
|
val latestDepTest = findProperty("testLatestDeps") as Boolean
|
||||||
|
@ -139,6 +136,7 @@ tasks {
|
||||||
// TODO run tests both with and without experimental span attributes
|
// TODO run tests both with and without experimental span attributes
|
||||||
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", "true")
|
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", "true")
|
||||||
systemProperty("otel.instrumentation.aws-sdk.experimental-record-individual-http-error", "true")
|
systemProperty("otel.instrumentation.aws-sdk.experimental-record-individual-http-error", "true")
|
||||||
|
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
|
||||||
}
|
}
|
||||||
|
|
||||||
withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>().configureEach {
|
withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>().configureEach {
|
||||||
|
|
|
@ -29,7 +29,6 @@ dependencies {
|
||||||
tasks {
|
tasks {
|
||||||
test {
|
test {
|
||||||
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", true)
|
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", true)
|
||||||
systemProperty("otel.instrumentation.aws-sdk.experimental-use-propagator-for-messaging", true)
|
|
||||||
systemProperty("otel.instrumentation.aws-sdk.experimental-record-individual-http-error", true)
|
systemProperty("otel.instrumentation.aws-sdk.experimental-record-individual-http-error", true)
|
||||||
systemProperty("otel.instrumentation.messaging.experimental.capture-headers", "test-message-header")
|
systemProperty("otel.instrumentation.messaging.experimental.capture-headers", "test-message-header")
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,9 +19,6 @@ dependencies {
|
||||||
testLibrary("software.amazon.awssdk:rds:2.2.0")
|
testLibrary("software.amazon.awssdk:rds:2.2.0")
|
||||||
testLibrary("software.amazon.awssdk:s3:2.2.0")
|
testLibrary("software.amazon.awssdk:s3:2.2.0")
|
||||||
testLibrary("software.amazon.awssdk:ses:2.2.0")
|
testLibrary("software.amazon.awssdk:ses:2.2.0")
|
||||||
|
|
||||||
// last version that does not use json protocol
|
|
||||||
latestDepTestLibrary("software.amazon.awssdk:sqs:2.21.17")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
testing {
|
testing {
|
||||||
|
@ -56,6 +53,6 @@ tasks {
|
||||||
// NB: If you'd like to change these, there is some cleanup work to be done, as most tests ignore this and
|
// NB: If you'd like to change these, there is some cleanup work to be done, as most tests ignore this and
|
||||||
// set the value directly (the "library" does not normally query it, only library-autoconfigure)
|
// set the value directly (the "library" does not normally query it, only library-autoconfigure)
|
||||||
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", true)
|
systemProperty("otel.instrumentation.aws-sdk.experimental-span-attributes", true)
|
||||||
systemProperty("otel.instrumentation.aws-sdk.experimental-use-propagator-for-messaging", true)
|
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ dependencies {
|
||||||
compileOnly("software.amazon.awssdk:ses:2.2.0")
|
compileOnly("software.amazon.awssdk:ses:2.2.0")
|
||||||
|
|
||||||
// needed for SQS - using emq directly as localstack references emq v0.15.7 ie WITHOUT AWS trace header propagation
|
// needed for SQS - using emq directly as localstack references emq v0.15.7 ie WITHOUT AWS trace header propagation
|
||||||
implementation("org.elasticmq:elasticmq-rest-sqs_2.12:1.0.0")
|
implementation("org.elasticmq:elasticmq-rest-sqs_2.13:1.5.1")
|
||||||
|
|
||||||
implementation("com.google.guava:guava")
|
implementation("com.google.guava:guava")
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,11 @@ package io.opentelemetry.instrumentation.awssdk.v2_2
|
||||||
|
|
||||||
|
|
||||||
import io.opentelemetry.semconv.SemanticAttributes
|
import io.opentelemetry.semconv.SemanticAttributes
|
||||||
|
import io.opentelemetry.testing.internal.armeria.common.HttpData
|
||||||
import io.opentelemetry.testing.internal.armeria.common.HttpResponse
|
import io.opentelemetry.testing.internal.armeria.common.HttpResponse
|
||||||
import io.opentelemetry.testing.internal.armeria.common.HttpStatus
|
import io.opentelemetry.testing.internal.armeria.common.HttpStatus
|
||||||
import io.opentelemetry.testing.internal.armeria.common.MediaType
|
import io.opentelemetry.testing.internal.armeria.common.MediaType
|
||||||
|
import io.opentelemetry.testing.internal.armeria.common.ResponseHeaders
|
||||||
import org.junit.jupiter.api.Assumptions
|
import org.junit.jupiter.api.Assumptions
|
||||||
import software.amazon.awssdk.core.ResponseInputStream
|
import software.amazon.awssdk.core.ResponseInputStream
|
||||||
import software.amazon.awssdk.core.async.AsyncResponseTransformer
|
import software.amazon.awssdk.core.async.AsyncResponseTransformer
|
||||||
|
@ -35,6 +37,7 @@ import software.amazon.awssdk.services.sqs.model.CreateQueueRequest
|
||||||
import software.amazon.awssdk.services.sqs.model.SendMessageRequest
|
import software.amazon.awssdk.services.sqs.model.SendMessageRequest
|
||||||
import spock.lang.Unroll
|
import spock.lang.Unroll
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
import java.util.concurrent.Future
|
import java.util.concurrent.Future
|
||||||
|
|
||||||
|
@ -59,6 +62,22 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
// bucket name as label.
|
// bucket name as label.
|
||||||
def clientUri = URI.create("http://localhost:${server.httpPort()}")
|
def clientUri = URI.create("http://localhost:${server.httpPort()}")
|
||||||
|
|
||||||
|
def s3ClientBuilder() {
|
||||||
|
def builder = S3Client.builder()
|
||||||
|
if (Boolean.getBoolean("testLatestDeps")) {
|
||||||
|
builder.forcePathStyle(true)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
|
def s3AsyncClientBuilder() {
|
||||||
|
def builder = S3AsyncClient.builder()
|
||||||
|
if (Boolean.getBoolean("testLatestDeps")) {
|
||||||
|
builder.forcePathStyle(true)
|
||||||
|
}
|
||||||
|
return builder
|
||||||
|
}
|
||||||
|
|
||||||
def "send #operation request with builder #builder.class.getName() mocked response"() {
|
def "send #operation request with builder #builder.class.getName() mocked response"() {
|
||||||
assumeSupportedConfig(service, operation)
|
assumeSupportedConfig(service, operation)
|
||||||
|
|
||||||
|
@ -69,9 +88,14 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
.region(Region.AP_NORTHEAST_1)
|
.region(Region.AP_NORTHEAST_1)
|
||||||
.credentialsProvider(CREDENTIALS_PROVIDER)
|
.credentialsProvider(CREDENTIALS_PROVIDER)
|
||||||
.build()
|
.build()
|
||||||
server.enqueue(HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, body))
|
|
||||||
def response = call.call(client)
|
|
||||||
|
|
||||||
|
if (body instanceof Closure) {
|
||||||
|
server.enqueue(body.call())
|
||||||
|
} else {
|
||||||
|
server.enqueue(HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, body))
|
||||||
|
}
|
||||||
|
|
||||||
|
def response = call.call(client)
|
||||||
if (response instanceof Future) {
|
if (response instanceof Future) {
|
||||||
response = response.get()
|
response = response.get()
|
||||||
}
|
}
|
||||||
|
@ -131,16 +155,33 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
|
|
||||||
where:
|
where:
|
||||||
service | operation | method | requestId | builder | call | body
|
service | operation | method | requestId | builder | call | body
|
||||||
"S3" | "CreateBucket" | "PUT" | "UNKNOWN" | S3Client.builder() | { c -> c.createBucket(CreateBucketRequest.builder().bucket("somebucket").build()) } | ""
|
"S3" | "CreateBucket" | "PUT" | "UNKNOWN" | s3ClientBuilder() | { c -> c.createBucket(CreateBucketRequest.builder().bucket("somebucket").build()) } | ""
|
||||||
"S3" | "GetObject" | "GET" | "UNKNOWN" | S3Client.builder() | { c -> c.getObject(GetObjectRequest.builder().bucket("somebucket").key("somekey").build()) } | ""
|
"S3" | "GetObject" | "GET" | "UNKNOWN" | s3ClientBuilder() | { c -> c.getObject(GetObjectRequest.builder().bucket("somebucket").key("somekey").build()) } | ""
|
||||||
"Kinesis" | "DeleteStream" | "POST" | "UNKNOWN" | KinesisClient.builder() | { c -> c.deleteStream(DeleteStreamRequest.builder().streamName("somestream").build()) } | ""
|
"Kinesis" | "DeleteStream" | "POST" | "UNKNOWN" | KinesisClient.builder() | { c -> c.deleteStream(DeleteStreamRequest.builder().streamName("somestream").build()) } | ""
|
||||||
"Sqs" | "CreateQueue" | "POST" | "7a62c49f-347e-4fc4-9331-6e8e7a96aa73" | SqsClient.builder() | { c -> c.createQueue(CreateQueueRequest.builder().queueName("somequeue").build()) } | """
|
"Sqs" | "CreateQueue" | "POST" | "7a62c49f-347e-4fc4-9331-6e8e7a96aa73" | SqsClient.builder() | { c -> c.createQueue(CreateQueueRequest.builder().queueName("somequeue").build()) } | {
|
||||||
|
if (!Boolean.getBoolean("testLatestDeps")) {
|
||||||
|
def content = """
|
||||||
<CreateQueueResponse>
|
<CreateQueueResponse>
|
||||||
<CreateQueueResult><QueueUrl>https://queue.amazonaws.com/123456789012/MyQueue</QueueUrl></CreateQueueResult>
|
<CreateQueueResult><QueueUrl>https://queue.amazonaws.com/123456789012/MyQueue</QueueUrl></CreateQueueResult>
|
||||||
<ResponseMetadata><RequestId>7a62c49f-347e-4fc4-9331-6e8e7a96aa73</RequestId></ResponseMetadata>
|
<ResponseMetadata><RequestId>7a62c49f-347e-4fc4-9331-6e8e7a96aa73</RequestId></ResponseMetadata>
|
||||||
</CreateQueueResponse>
|
</CreateQueueResponse>
|
||||||
"""
|
"""
|
||||||
"Sqs" | "SendMessage" | "POST" | "27daac76-34dd-47df-bd01-1f6e873584a0" | SqsClient.builder() | { c -> c.sendMessage(SendMessageRequest.builder().queueUrl(QUEUE_URL).messageBody("").build()) } | """
|
return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, content)
|
||||||
|
}
|
||||||
|
def content = """
|
||||||
|
{
|
||||||
|
"QueueUrl":"https://queue.amazonaws.com/123456789012/MyQueue"
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
ResponseHeaders headers = ResponseHeaders.builder(HttpStatus.OK)
|
||||||
|
.contentType(MediaType.PLAIN_TEXT_UTF_8)
|
||||||
|
.add("x-amzn-RequestId", "7a62c49f-347e-4fc4-9331-6e8e7a96aa73")
|
||||||
|
.build()
|
||||||
|
return HttpResponse.of(headers, HttpData.of(StandardCharsets.UTF_8, content))
|
||||||
|
}
|
||||||
|
"Sqs" | "SendMessage" | "POST" | "27daac76-34dd-47df-bd01-1f6e873584a0" | SqsClient.builder() | { c -> c.sendMessage(SendMessageRequest.builder().queueUrl(QUEUE_URL).messageBody("").build()) } | {
|
||||||
|
if (!Boolean.getBoolean("testLatestDeps")) {
|
||||||
|
def content = """
|
||||||
<SendMessageResponse>
|
<SendMessageResponse>
|
||||||
<SendMessageResult>
|
<SendMessageResult>
|
||||||
<MD5OfMessageBody>d41d8cd98f00b204e9800998ecf8427e</MD5OfMessageBody>
|
<MD5OfMessageBody>d41d8cd98f00b204e9800998ecf8427e</MD5OfMessageBody>
|
||||||
|
@ -150,6 +191,21 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
<ResponseMetadata><RequestId>27daac76-34dd-47df-bd01-1f6e873584a0</RequestId></ResponseMetadata>
|
<ResponseMetadata><RequestId>27daac76-34dd-47df-bd01-1f6e873584a0</RequestId></ResponseMetadata>
|
||||||
</SendMessageResponse>
|
</SendMessageResponse>
|
||||||
"""
|
"""
|
||||||
|
return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, content)
|
||||||
|
}
|
||||||
|
def content = """
|
||||||
|
{
|
||||||
|
"MD5OfMessageBody":"d41d8cd98f00b204e9800998ecf8427e",
|
||||||
|
"MD5OfMessageAttributes":"3ae8f24a165a8cedc005670c81a27295",
|
||||||
|
"MessageId":"5fea7756-0ea4-451a-a703-a558b933e274"
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
ResponseHeaders headers = ResponseHeaders.builder(HttpStatus.OK)
|
||||||
|
.contentType(MediaType.PLAIN_TEXT_UTF_8)
|
||||||
|
.add("x-amzn-RequestId", "27daac76-34dd-47df-bd01-1f6e873584a0")
|
||||||
|
.build()
|
||||||
|
return HttpResponse.of(headers, HttpData.of(StandardCharsets.UTF_8, content))
|
||||||
|
}
|
||||||
"Ec2" | "AllocateAddress" | "POST" | "59dbff89-35bd-4eac-99ed-be587EXAMPLE" | Ec2Client.builder() | { c -> c.allocateAddress() } | """
|
"Ec2" | "AllocateAddress" | "POST" | "59dbff89-35bd-4eac-99ed-be587EXAMPLE" | Ec2Client.builder() | { c -> c.allocateAddress() } | """
|
||||||
<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
|
<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
|
||||||
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
|
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
|
||||||
|
@ -173,9 +229,14 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
.region(Region.AP_NORTHEAST_1)
|
.region(Region.AP_NORTHEAST_1)
|
||||||
.credentialsProvider(CREDENTIALS_PROVIDER)
|
.credentialsProvider(CREDENTIALS_PROVIDER)
|
||||||
.build()
|
.build()
|
||||||
server.enqueue(HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, body))
|
|
||||||
def response = call.call(client)
|
|
||||||
|
|
||||||
|
if (body instanceof Closure) {
|
||||||
|
server.enqueue(body.call())
|
||||||
|
} else {
|
||||||
|
server.enqueue(HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, body))
|
||||||
|
}
|
||||||
|
|
||||||
|
def response = call.call(client)
|
||||||
if (response instanceof Future) {
|
if (response instanceof Future) {
|
||||||
response = response.get()
|
response = response.get()
|
||||||
}
|
}
|
||||||
|
@ -199,7 +260,7 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
"$SemanticAttributes.HTTP_URL" { it.startsWith("http://somebucket.localhost:${server.httpPort()}") || it.startsWith("http://localhost:${server.httpPort()}") }
|
"$SemanticAttributes.HTTP_URL" { it.startsWith("http://somebucket.localhost:${server.httpPort()}") || it.startsWith("http://localhost:${server.httpPort()}") }
|
||||||
} else {
|
} else {
|
||||||
"$SemanticAttributes.NET_PEER_NAME" "localhost"
|
"$SemanticAttributes.NET_PEER_NAME" "localhost"
|
||||||
"$SemanticAttributes.HTTP_URL" "http://localhost:${server.httpPort()}"
|
"$SemanticAttributes.HTTP_URL" { it == "http://localhost:${server.httpPort()}" || it == "http://localhost:${server.httpPort()}/" }
|
||||||
}
|
}
|
||||||
"$SemanticAttributes.NET_PEER_PORT" server.httpPort()
|
"$SemanticAttributes.NET_PEER_PORT" server.httpPort()
|
||||||
"$SemanticAttributes.HTTP_METHOD" "$method"
|
"$SemanticAttributes.HTTP_METHOD" "$method"
|
||||||
|
@ -245,17 +306,34 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
|
|
||||||
where:
|
where:
|
||||||
service | operation | method | requestId | builder | call | body
|
service | operation | method | requestId | builder | call | body
|
||||||
"S3" | "CreateBucket" | "PUT" | "UNKNOWN" | S3AsyncClient.builder() | { c -> c.createBucket(CreateBucketRequest.builder().bucket("somebucket").build()) } | ""
|
"S3" | "CreateBucket" | "PUT" | "UNKNOWN" | s3AsyncClientBuilder() | { c -> c.createBucket(CreateBucketRequest.builder().bucket("somebucket").build()) } | ""
|
||||||
"S3" | "GetObject" | "GET" | "UNKNOWN" | S3AsyncClient.builder() | { c -> c.getObject(GetObjectRequest.builder().bucket("somebucket").key("somekey").build(), AsyncResponseTransformer.toBytes()) } | "1234567890"
|
"S3" | "GetObject" | "GET" | "UNKNOWN" | s3AsyncClientBuilder() | { c -> c.getObject(GetObjectRequest.builder().bucket("somebucket").key("somekey").build(), AsyncResponseTransformer.toBytes()) } | "1234567890"
|
||||||
// Kinesis seems to expect an http2 response which is incompatible with our test server.
|
// Kinesis seems to expect an http2 response which is incompatible with our test server.
|
||||||
// "Kinesis" | "DeleteStream" | "POST" | "/" | "UNKNOWN" | KinesisAsyncClient.builder() | { c -> c.deleteStream(DeleteStreamRequest.builder().streamName("somestream").build()) } | ""
|
// "Kinesis" | "DeleteStream" | "POST" | "/" | "UNKNOWN" | KinesisAsyncClient.builder() | { c -> c.deleteStream(DeleteStreamRequest.builder().streamName("somestream").build()) } | ""
|
||||||
"Sqs" | "CreateQueue" | "POST" | "7a62c49f-347e-4fc4-9331-6e8e7a96aa73" | SqsAsyncClient.builder() | { c -> c.createQueue(CreateQueueRequest.builder().queueName("somequeue").build()) } | """
|
"Sqs" | "CreateQueue" | "POST" | "7a62c49f-347e-4fc4-9331-6e8e7a96aa73" | SqsAsyncClient.builder() | { c -> c.createQueue(CreateQueueRequest.builder().queueName("somequeue").build()) } | {
|
||||||
|
if (!Boolean.getBoolean("testLatestDeps")) {
|
||||||
|
def content = """
|
||||||
<CreateQueueResponse>
|
<CreateQueueResponse>
|
||||||
<CreateQueueResult><QueueUrl>https://queue.amazonaws.com/123456789012/MyQueue</QueueUrl></CreateQueueResult>
|
<CreateQueueResult><QueueUrl>https://queue.amazonaws.com/123456789012/MyQueue</QueueUrl></CreateQueueResult>
|
||||||
<ResponseMetadata><RequestId>7a62c49f-347e-4fc4-9331-6e8e7a96aa73</RequestId></ResponseMetadata>
|
<ResponseMetadata><RequestId>7a62c49f-347e-4fc4-9331-6e8e7a96aa73</RequestId></ResponseMetadata>
|
||||||
</CreateQueueResponse>
|
</CreateQueueResponse>
|
||||||
"""
|
"""
|
||||||
"Sqs" | "SendMessage" | "POST" | "27daac76-34dd-47df-bd01-1f6e873584a0" | SqsAsyncClient.builder() | { c -> c.sendMessage(SendMessageRequest.builder().queueUrl(QUEUE_URL).messageBody("").build()) } | """
|
return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, content)
|
||||||
|
}
|
||||||
|
def content = """
|
||||||
|
{
|
||||||
|
"QueueUrl":"https://queue.amazonaws.com/123456789012/MyQueue"
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
ResponseHeaders headers = ResponseHeaders.builder(HttpStatus.OK)
|
||||||
|
.contentType(MediaType.PLAIN_TEXT_UTF_8)
|
||||||
|
.add("x-amzn-RequestId", "7a62c49f-347e-4fc4-9331-6e8e7a96aa73")
|
||||||
|
.build()
|
||||||
|
return HttpResponse.of(headers, HttpData.of(StandardCharsets.UTF_8, content))
|
||||||
|
}
|
||||||
|
"Sqs" | "SendMessage" | "POST" | "27daac76-34dd-47df-bd01-1f6e873584a0" | SqsAsyncClient.builder() | { c -> c.sendMessage(SendMessageRequest.builder().queueUrl(QUEUE_URL).messageBody("").build()) } | {
|
||||||
|
if (!Boolean.getBoolean("testLatestDeps")) {
|
||||||
|
def content = """
|
||||||
<SendMessageResponse>
|
<SendMessageResponse>
|
||||||
<SendMessageResult>
|
<SendMessageResult>
|
||||||
<MD5OfMessageBody>d41d8cd98f00b204e9800998ecf8427e</MD5OfMessageBody>
|
<MD5OfMessageBody>d41d8cd98f00b204e9800998ecf8427e</MD5OfMessageBody>
|
||||||
|
@ -265,6 +343,21 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
<ResponseMetadata><RequestId>27daac76-34dd-47df-bd01-1f6e873584a0</RequestId></ResponseMetadata>
|
<ResponseMetadata><RequestId>27daac76-34dd-47df-bd01-1f6e873584a0</RequestId></ResponseMetadata>
|
||||||
</SendMessageResponse>
|
</SendMessageResponse>
|
||||||
"""
|
"""
|
||||||
|
return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8, content)
|
||||||
|
}
|
||||||
|
def content = """
|
||||||
|
{
|
||||||
|
"MD5OfMessageBody":"d41d8cd98f00b204e9800998ecf8427e",
|
||||||
|
"MD5OfMessageAttributes":"3ae8f24a165a8cedc005670c81a27295",
|
||||||
|
"MessageId":"5fea7756-0ea4-451a-a703-a558b933e274"
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
ResponseHeaders headers = ResponseHeaders.builder(HttpStatus.OK)
|
||||||
|
.contentType(MediaType.PLAIN_TEXT_UTF_8)
|
||||||
|
.add("x-amzn-RequestId", "27daac76-34dd-47df-bd01-1f6e873584a0")
|
||||||
|
.build()
|
||||||
|
return HttpResponse.of(headers, HttpData.of(StandardCharsets.UTF_8, content))
|
||||||
|
}
|
||||||
"Ec2" | "AllocateAddress" | "POST" | "59dbff89-35bd-4eac-99ed-be587EXAMPLE" | Ec2AsyncClient.builder() | { c -> c.allocateAddress() } | """
|
"Ec2" | "AllocateAddress" | "POST" | "59dbff89-35bd-4eac-99ed-be587EXAMPLE" | Ec2AsyncClient.builder() | { c -> c.allocateAddress() } | """
|
||||||
<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
|
<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
|
||||||
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
|
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
|
||||||
|
@ -297,7 +390,7 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
// One retry so two requests.
|
// One retry so two requests.
|
||||||
server.enqueue(HttpResponse.delayed(HttpResponse.of(HttpStatus.OK), Duration.ofMillis(5000)))
|
server.enqueue(HttpResponse.delayed(HttpResponse.of(HttpStatus.OK), Duration.ofMillis(5000)))
|
||||||
server.enqueue(HttpResponse.delayed(HttpResponse.of(HttpStatus.OK), Duration.ofMillis(5000)))
|
server.enqueue(HttpResponse.delayed(HttpResponse.of(HttpStatus.OK), Duration.ofMillis(5000)))
|
||||||
def client = S3Client.builder()
|
def builder = S3Client.builder()
|
||||||
.overrideConfiguration(createOverrideConfigurationBuilder()
|
.overrideConfiguration(createOverrideConfigurationBuilder()
|
||||||
.retryPolicy(RetryPolicy.builder().numRetries(1).build())
|
.retryPolicy(RetryPolicy.builder().numRetries(1).build())
|
||||||
.build())
|
.build())
|
||||||
|
@ -305,7 +398,12 @@ abstract class AbstractAws2ClientTest extends AbstractAws2ClientCoreTest {
|
||||||
.region(Region.AP_NORTHEAST_1)
|
.region(Region.AP_NORTHEAST_1)
|
||||||
.credentialsProvider(CREDENTIALS_PROVIDER)
|
.credentialsProvider(CREDENTIALS_PROVIDER)
|
||||||
.httpClientBuilder(ApacheHttpClient.builder().socketTimeout(Duration.ofMillis(50)))
|
.httpClientBuilder(ApacheHttpClient.builder().socketTimeout(Duration.ofMillis(50)))
|
||||||
.build()
|
|
||||||
|
if (Boolean.getBoolean("testLatestDeps")) {
|
||||||
|
builder.forcePathStyle(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
def client = builder.build()
|
||||||
|
|
||||||
when:
|
when:
|
||||||
client.getObject(GetObjectRequest.builder().bucket("somebucket").key("somekey").build())
|
client.getObject(GetObjectRequest.builder().bucket("somebucket").key("somekey").build())
|
||||||
|
|
|
@ -125,7 +125,7 @@ abstract class AbstractAws2SqsSuppressReceiveSpansTest extends InstrumentationSp
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.queue.name" "testSdkSqs"
|
"aws.queue.name" "testSdkSqs"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
"rpc.service" "Sqs"
|
"rpc.service" "Sqs"
|
||||||
"rpc.method" "CreateQueue"
|
"rpc.method" "CreateQueue"
|
||||||
|
@ -147,7 +147,7 @@ abstract class AbstractAws2SqsSuppressReceiveSpansTest extends InstrumentationSp
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
"rpc.method" "SendMessage"
|
"rpc.method" "SendMessage"
|
||||||
"rpc.service" "Sqs"
|
"rpc.service" "Sqs"
|
||||||
|
@ -209,7 +209,7 @@ abstract class AbstractAws2SqsSuppressReceiveSpansTest extends InstrumentationSp
|
||||||
hasNoLinks()
|
hasNoLinks()
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.method" "ReceiveMessage"
|
"rpc.method" "ReceiveMessage"
|
||||||
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
|
@ -323,7 +323,7 @@ abstract class AbstractAws2SqsSuppressReceiveSpansTest extends InstrumentationSp
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it.trim() == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
"rpc.method" "SendMessageBatch"
|
"rpc.method" "SendMessageBatch"
|
||||||
"rpc.service" "Sqs"
|
"rpc.service" "Sqs"
|
||||||
|
|
|
@ -127,7 +127,7 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification {
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.queue.name" "testSdkSqs"
|
"aws.queue.name" "testSdkSqs"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
"rpc.service" "Sqs"
|
"rpc.service" "Sqs"
|
||||||
"rpc.method" "CreateQueue"
|
"rpc.method" "CreateQueue"
|
||||||
|
@ -149,7 +149,7 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification {
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
"rpc.method" "SendMessage"
|
"rpc.method" "SendMessage"
|
||||||
"rpc.service" "Sqs"
|
"rpc.service" "Sqs"
|
||||||
|
@ -189,7 +189,7 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification {
|
||||||
hasNoLinks()
|
hasNoLinks()
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.method" "ReceiveMessage"
|
"rpc.method" "ReceiveMessage"
|
||||||
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
|
@ -389,7 +389,7 @@ abstract class AbstractAws2SqsTracingTest extends InstrumentationSpecification {
|
||||||
attributes {
|
attributes {
|
||||||
"aws.agent" "java-aws-sdk"
|
"aws.agent" "java-aws-sdk"
|
||||||
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
"aws.queue.url" "http://localhost:$sqsPort/000000000000/testSdkSqs"
|
||||||
"aws.requestId" "00000000-0000-0000-0000-000000000000"
|
"aws.requestId" { it.trim() == "00000000-0000-0000-0000-000000000000" || it == "UNKNOWN" }
|
||||||
"rpc.system" "aws-api"
|
"rpc.system" "aws-api"
|
||||||
"rpc.method" "SendMessageBatch"
|
"rpc.method" "SendMessageBatch"
|
||||||
"rpc.service" "Sqs"
|
"rpc.service" "Sqs"
|
||||||
|
|
Loading…
Reference in New Issue