From 86ec15f19c51610315590ccdf85f5b01efade92b 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 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