use of software.amazon.awssdk.services.s3.model.DeleteObjectsResponse in project cwa-server by corona-warn-app.
the class S3ClientWrapperTest method removeObjectsThrowsOnDeletionErrors.
@Test
void removeObjectsThrowsOnDeletionErrors() {
DeleteObjectsResponse actResponse = DeleteObjectsResponse.builder().errors(S3Error.builder().build()).build();
when(s3Client.deleteObjects(any(DeleteObjectsRequest.class))).thenReturn(actResponse);
List<String> targetObjects = List.of(VALID_NAME);
assertThatExceptionOfType(ObjectStoreOperationFailedException.class).isThrownBy(() -> s3ClientWrapper.removeObjects(VALID_BUCKET_NAME, targetObjects));
}
use of software.amazon.awssdk.services.s3.model.DeleteObjectsResponse in project newrelic-java-agent by newrelic.
the class S3AsyncClient_Instrumentation method deleteObjects.
public CompletableFuture<DeleteObjectsResponse> deleteObjects(DeleteObjectsRequest deleteObjectsRequest) {
String uri = "s3://" + deleteObjectsRequest.bucket();
Segment segment = NewRelic.getAgent().getTransaction().startSegment("S3", "deleteObjects");
AgentBridge.getAgent().getTracedMethod().setTrackChildThreads(false);
CompletableFuture<DeleteObjectsResponse> result = Weaver.callOriginal();
return result.whenComplete(new S3ResponseResultWrapper<>(segment, uri, "deleteObjects"));
}
use of software.amazon.awssdk.services.s3.model.DeleteObjectsResponse in project newrelic-java-agent by newrelic.
the class S3Client_Instrumentation method deleteObjects.
@Trace
public DeleteObjectsResponse deleteObjects(DeleteObjectsRequest deleteObjectsRequest) {
String uri = "s3://" + deleteObjectsRequest.bucket();
try {
DeleteObjectsResponse deleteObjectsResponse = Weaver.callOriginal();
S3MetricUtil.reportExternalMetrics(NewRelic.getAgent().getTracedMethod(), uri, deleteObjectsResponse, "deleteObjects");
return deleteObjectsResponse;
} catch (Exception e) {
S3MetricUtil.reportExternalMetrics(NewRelic.getAgent().getTracedMethod(), uri, "deleteObjects");
throw e;
}
}
Aggregations