Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public final class TracingRequestHandler extends RequestHandler2 {

private static final RequestHandler2 DELEGATE = buildDelegate(GlobalOpenTelemetry.get());
private static final RequestHandler2 delegate = buildDelegate(GlobalOpenTelemetry.get());

@SuppressWarnings("deprecation") // using deprecated config property
private static RequestHandler2 buildDelegate(OpenTelemetry openTelemetry) {
Expand Down Expand Up @@ -56,21 +56,21 @@ private static RequestHandler2 buildDelegate(OpenTelemetry openTelemetry) {

@Override
public void beforeRequest(Request<?> request) {
DELEGATE.beforeRequest(request);
delegate.beforeRequest(request);
}

@Override
public AmazonWebServiceRequest beforeMarshalling(AmazonWebServiceRequest request) {
return DELEGATE.beforeMarshalling(request);
return delegate.beforeMarshalling(request);
}

@Override
public void afterResponse(Request<?> request, Response<?> response) {
DELEGATE.afterResponse(request, response);
delegate.afterResponse(request, response);
}

@Override
public void afterError(Request<?> request, Response<?> response, Exception e) {
DELEGATE.afterError(request, response, e);
delegate.afterError(request, response, e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected InstrumentationExtension testing() {
}

@Override
public AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
protected AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
return client;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected InstrumentationExtension testing() {
}

@Override
public AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
protected AmazonSQSAsyncClientBuilder configureClient(AmazonSQSAsyncClientBuilder client) {
return client;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void assertRequestWithMockedResponse(
String operation,
String method,
List<AttributeAssertion> additionalAttributes)
throws Exception {
throws ReflectiveOperationException {

assertThat(response).isNotNull();

Expand Down Expand Up @@ -125,7 +125,8 @@ public void assertRequestWithMockedResponse(
}

@SuppressWarnings("unchecked")
protected List<RequestHandler2> extractRequestHandlers(Object client) throws Exception {
protected List<RequestHandler2> extractRequestHandlers(Object client)
throws ReflectiveOperationException {
Field requestHandler2sField = AmazonWebServiceClient.class.getDeclaredField("requestHandler2s");
requestHandler2sField.setAccessible(true);
return (List<RequestHandler2>) requestHandler2sField.get(client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected boolean hasRequestId() {

@SuppressWarnings("deprecation") // using deprecated semconv
@Test
void sendRequestWithMockedResponse() throws Exception {
void sendRequestWithMockedResponse() throws ReflectiveOperationException {
AmazonDynamoDBClientBuilder clientBuilder = AmazonDynamoDBClientBuilder.standard();
AmazonDynamoDB client =
configureClient(clientBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected boolean hasRequestId() {
}

@Test
void sendRequestWithMockedResponse() throws Exception {
void sendRequestWithMockedResponse() throws ReflectiveOperationException {
AmazonEC2ClientBuilder clientBuilder = AmazonEC2ClientBuilder.standard();
AmazonEC2 client =
configureClient(clientBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected boolean hasRequestId() {
@ParameterizedTest
@MethodSource("provideArguments")
void testSendRequestWithMockedResponse(String operation, Function<AmazonKinesis, Object> call)
throws Exception {
throws ReflectiveOperationException {
AmazonKinesisClientBuilder clientBuilder = AmazonKinesisClientBuilder.standard();

AmazonKinesis client =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void testSendRequestWithMockedResponse(
String responseBody,
List<AttributeAssertion> additionalAttributes,
Function<AWSLambda, Object> call)
throws Exception {
throws ReflectiveOperationException {
AWSLambdaClientBuilder clientBuilder = AWSLambdaClientBuilder.standard();
AWSLambda client =
configureClient(clientBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected boolean hasRequestId() {
}

@Test
void sendRequestWithMockedResponse() throws Exception {
void sendRequestWithMockedResponse() throws ReflectiveOperationException {
AmazonRDSClientBuilder clientBuilder = AmazonRDSClientBuilder.standard();
AmazonRDS client =
configureClient(clientBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void testSendRequestWithMockedResponse(
String method,
Function<AmazonS3, Object> call,
List<AttributeAssertion> additionalAttributes)
throws Exception {
throws ReflectiveOperationException {

AmazonS3 client =
configureClient(clientBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected boolean hasRequestId() {
}

@Test
void sendCreateSecretRequestWithMockedResponse() throws Exception {
void sendCreateSecretRequestWithMockedResponse() throws ReflectiveOperationException {
AWSSecretsManagerClientBuilder clientBuilder = AWSSecretsManagerClientBuilder.standard();
AWSSecretsManager client =
configureClient(clientBuilder)
Expand Down Expand Up @@ -62,7 +62,7 @@ void sendCreateSecretRequestWithMockedResponse() throws Exception {
}

@Test
void sendDescribeSecretRequestWithMockedResponse() throws Exception {
void sendDescribeSecretRequestWithMockedResponse() throws ReflectiveOperationException {
AWSSecretsManagerClientBuilder clientBuilder = AWSSecretsManagerClientBuilder.standard();
AWSSecretsManager client =
configureClient(clientBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void testSendRequestWithMockedResponse(
String operation,
String responseBody,
List<AttributeAssertion> additionalAttributes)
throws Exception {
throws ReflectiveOperationException {
AmazonSNSClientBuilder clientBuilder = AmazonSNSClientBuilder.standard();
AmazonSNS client =
configureClient(clientBuilder)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void testSendRequestWithMockedResponse(
String operation,
List<AttributeAssertion> additionalAttributes,
Function<AWSStepFunctions, Object> call)
throws Exception {
throws ReflectiveOperationException {

AWSStepFunctionsClientBuilder clientBuilder = AWSStepFunctionsClientBuilder.standard();

Expand Down
Loading