From e3e0693e4f0049683937658386ab7012c5c20e8a Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Sat, 6 Mar 2021 01:57:13 +0100 Subject: [PATCH] =?UTF-8?q?Adds=20test=20case=20checking=20listing=20of=20?= =?UTF-8?q?objects=20=F0=9F=95=B5=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MISC-24 --- src/test/java/BaseAWSSpec.groovy | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/test/java/BaseAWSSpec.groovy b/src/test/java/BaseAWSSpec.groovy index 4dc0395..3141009 100644 --- a/src/test/java/BaseAWSSpec.groovy +++ b/src/test/java/BaseAWSSpec.groovy @@ -128,6 +128,33 @@ abstract class BaseAWSSpec extends BaseSpecification { downloadedData == "Test" } + def "PUT and then LIST work as expected"() { + given: + def client = getClient() + when: + if (client.doesBucketExist("test")) { + client.deleteBucket("test") + } + client.createBucket("test") + and: + client.putObject( + "test", + "Eins", + new ByteArrayInputStream("Eins".getBytes(Charsets.UTF_8)), + new ObjectMetadata()) + client.putObject( + "test", + "Zwei", + new ByteArrayInputStream("Zwei".getBytes(Charsets.UTF_8)), + new ObjectMetadata()) + then: + def listing = client.listObjects("test") + def summaries = listing.getObjectSummaries() + summaries.size() == 2 + summaries.get(0).getKey() == "Eins" + summaries.get(1).getKey() == "Zwei" + } + def "PUT and then DELETE work as expected"() { given: def client = getClient()