From cca6d9bef943cc528e9cb6d093b237e501980b1e Mon Sep 17 00:00:00 2001 From: Jorge Esteban Quilcate Otoya Date: Tue, 26 Sep 2023 13:11:34 +0300 Subject: [PATCH] chore: properly build and autoclose s3 client --- .../tieredstorage/storage/s3/S3StorageMetricsTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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