From 0e9390da02ae47ae142f9e2f1e00d43bd3d01b50 Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Thu, 23 Feb 2023 03:18:38 +0100 Subject: [PATCH] =?UTF-8?q?Moves=20helper=20method=20up=20=F0=9F=91=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Vogel #209 --- src/test/java/BaseAWSSpec.groovy | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/BaseAWSSpec.groovy b/src/test/java/BaseAWSSpec.groovy index 6e1d5c7..9836e3c 100644 --- a/src/test/java/BaseAWSSpec.groovy +++ b/src/test/java/BaseAWSSpec.groovy @@ -32,6 +32,16 @@ abstract class BaseAWSSpec extends BaseSpecification { abstract AmazonS3Client getClient() + private void putObjectWithContent(String bucketName, String key, String content) { + def client = getClient() + def data = content.getBytes(Charsets.UTF_8) + + def metadata = new ObjectMetadata() + metadata.setHeader(Headers.CONTENT_LENGTH, new Long(data.length)) + + client.putObject(bucketName, key, new ByteArrayInputStream(data), metadata) + } + def "HEAD of non-existing bucket as expected"() { given: def bucketName = "does-not-exist" @@ -382,14 +392,4 @@ abstract class BaseAWSSpec extends BaseSpecification { client.deleteObject(bucketName, key2) client.deleteObject(bucketName, key3) } - - private void putObjectWithContent(String bucketName, String key, String content) { - def client = getClient() - def data = content.getBytes(Charsets.UTF_8) - - def metadata = new ObjectMetadata() - metadata.setHeader(Headers.CONTENT_LENGTH, new Long(data.length)) - - client.putObject(bucketName, key, new ByteArrayInputStream(data), metadata) - } }