Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca committed Dec 15, 2024
1 parent 13ff8a0 commit e6ce028
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ boolean isSqsAttributeInjectionEnabled() {
}

@Override
boolean isXrayInjectionEnabled() {
protected boolean isXrayInjectionEnabled() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ boolean isSqsAttributeInjectionEnabled() {
}

@Override
boolean isXrayInjectionEnabled() {
protected boolean isXrayInjectionEnabled() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import software.amazon.awssdk.services.sqs.model.SendMessageRequest;

public abstract class AbstractAws2SqsBaseTest {

protected abstract InstrumentationExtension getTesting();

protected abstract SqsClient configureSqsClient(SqsClient sqsClient);
Expand All @@ -64,12 +63,16 @@ public abstract class AbstractAws2SqsBaseTest {

protected abstract ClientOverrideConfiguration.Builder createOverrideConfigurationBuilder();

protected abstract void assertSqsTraces(Boolean withParent, Boolean captureHeaders);

protected static final StaticCredentialsProvider CREDENTIALS_PROVIDER =
StaticCredentialsProvider.create(
AwsBasicCredentials.create("my-access-key", "my-secret-key"));

protected static int sqsPort;
protected static SQSRestServer sqs;
static int sqsPort;
static SQSRestServer sqs;

protected final String queueUrl = "http://localhost:" + sqsPort + "/000000000000/testSdkSqs";

static Map<String, MessageAttributeValue> dummyMessageAttributes(int count) {
Map<String, MessageAttributeValue> map = new HashMap<>();
Expand All @@ -80,8 +83,6 @@ static Map<String, MessageAttributeValue> dummyMessageAttributes(int count) {
return map;
}

protected final String queueUrl = "http://localhost:" + sqsPort + "/000000000000/testSdkSqs";

ReceiveMessageRequest receiveMessageRequest =
ReceiveMessageRequest.builder().queueUrl(queueUrl).build();

Expand Down Expand Up @@ -111,11 +112,11 @@ static Map<String, MessageAttributeValue> dummyMessageAttributes(int count) {
e -> e.messageBody("e3").id("i3").messageAttributes(dummyMessageAttributes(10)))
.build();

boolean isXrayInjectionEnabled() {
protected boolean isXrayInjectionEnabled() {
return true;
}

protected void configureSdkClient(SqsClientBuilder builder) throws URISyntaxException {
void configureSdkClient(SqsClientBuilder builder) throws URISyntaxException {
builder
.overrideConfiguration(createOverrideConfigurationBuilder().build())
.endpointOverride(new URI("http://localhost:" + sqsPort));
Expand All @@ -135,8 +136,6 @@ boolean isSqsAttributeInjectionEnabled() {
"otel.instrumentation.aws-sdk.experimental-use-propagator-for-messaging", false);
}

protected abstract void assertSqsTraces(Boolean withParent, Boolean captureHeaders);

@BeforeAll
static void setUp() {
sqs = SQSRestServerBuilder.withPort(0).withInterface("localhost").start();
Expand Down

0 comments on commit e6ce028

Please sign in to comment.