Skip to content

Commit

Permalink
move things
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydeluca committed Dec 23, 2024
1 parent 57ef25c commit d2dc050
Showing 1 changed file with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ public abstract class AbstractAws2ClientCoreTest {

protected static final MockWebServerExtension server = new MockWebServerExtension();

private static final ImmutableMap<String, AttributeValue> createTableRequestKey =
ImmutableMap.of(
"anotherKey", AttributeValue.builder().s("value").build(),
"key", AttributeValue.builder().s("value").build());

private static final ImmutableMap<String, AttributeValue> getItemRequestKey =
ImmutableMap.of(
"keyOne", AttributeValue.builder().s("value").build(),
"keyTwo", AttributeValue.builder().s("differentValue").build());

private static final ImmutableMap<String, AttributeValue> putItemRequestKey =
ImmutableMap.of(
"key", AttributeValue.builder().s("value").build(),
"attributeOne", AttributeValue.builder().s("one").build(),
"attributeTwo", AttributeValue.builder().s("two").build());

protected abstract InstrumentationExtension getTesting();

protected abstract ClientOverrideConfiguration.Builder createOverrideConfigurationBuilder();
Expand All @@ -80,6 +96,10 @@ protected static boolean isSqsAttributeInjectionEnabled() {
"otel.instrumentation.aws-sdk.experimental-use-propagator-for-messaging", false);
}

protected void configureSdkClient(SdkClientBuilder<?, ?> builder) {
builder.overrideConfiguration(createOverrideConfigurationBuilder().build());
}

@BeforeAll
static void setup() {
server.start();
Expand All @@ -95,26 +115,6 @@ void prepTest() {
server.beforeTestExecution(null);
}

protected void configureSdkClient(SdkClientBuilder<?, ?> builder) {
builder.overrideConfiguration(createOverrideConfigurationBuilder().build());
}

private static final ImmutableMap<String, AttributeValue> createTableRequestKey =
ImmutableMap.of(
"anotherKey", AttributeValue.builder().s("value").build(),
"key", AttributeValue.builder().s("value").build());

private static final ImmutableMap<String, AttributeValue> getItemRequestKey =
ImmutableMap.of(
"keyOne", AttributeValue.builder().s("value").build(),
"keyTwo", AttributeValue.builder().s("differentValue").build());

private static final ImmutableMap<String, AttributeValue> putItemRequestKey =
ImmutableMap.of(
"key", AttributeValue.builder().s("value").build(),
"attributeOne", AttributeValue.builder().s("one").build(),
"attributeTwo", AttributeValue.builder().s("two").build());

private void validateOperationResponse(String operation, Object response)
throws ExecutionException, InterruptedException {
if (response instanceof Future) {
Expand Down

0 comments on commit d2dc050

Please sign in to comment.