diff --git a/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java b/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java index 5c399c805..076c44f43 100644 --- a/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java +++ b/storage/s3/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/s3/S3StorageMetricsTest.java @@ -74,10 +74,10 @@ static void setupS3() { LOCALSTACK.getSecretKey() ) ) - ) - .build(); - final S3Client s3Client = clientBuilder.build(); - s3Client.createBucket(CreateBucketRequest.builder().bucket(BUCKET_NAME).build()); + ); + try (final S3Client s3Client = clientBuilder.build()) { + s3Client.createBucket(CreateBucketRequest.builder().bucket(BUCKET_NAME).build()); + } } @BeforeEach