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 406b4d850..1d627aa35 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 @@ -76,10 +76,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