package org.cloudfoundry.community.servicebroker.s3;

import org.cloudfoundry.community.servicebroker.ServiceBrokerV2IntegrationTestBase;
import org.cloudfoundry.community.servicebroker.s3.config.Application;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
import org.springframework.boot.test.SpringApplicationConfiguration;

@SpringApplicationConfiguration(classes = Application.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class S3ServiceBrokerV2IntegrationTests extends ServiceBrokerV2IntegrationTestBase {
}

@@ -47,16 +47,108 @@
 er.s3;%0A%0A
+import com.amazonaws.services.s3.AmazonS3;%0Aimport com.amazonaws.services.s3.AmazonS3Client;%0A
 import o
@@ -223,16 +223,16 @@
 stBase;%0A
-
 import o
@@ -294,16 +294,41 @@
 cation;%0A
+import org.junit.Before;%0A
 import o
@@ -392,16 +392,75 @@
 orters;%0A
+import org.springframework.beans.factory.annotation.Value;%0A
 import o
@@ -521,16 +521,104 @@
 ation;%0A%0A
+import static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0A
 @SpringA
@@ -716,16 +716,16 @@
 ENDING)%0A
-
 public c
@@ -807,11 +807,736 @@
 stBase %7B
+%0A%0A    private AmazonS3 s3;%0A%0A    @Value(%22$%7BBUCKET_NAME_PREFIX:cloud-foundry-%7D%22)%0A    private String  bucketNamePrefix;%0A%0A    @Override%0A    @Before%0A    public void setUp() throws Exception %7B%0A        super.setUp();%0A        s3 = new AmazonS3Client();%0A    %7D%0A%0A    @Override%0A    public void case2_provisionInstanceSucceedsWithCredentials() throws Exception %7B%0A        super.case2_provisionInstanceSucceedsWithCredentials();%0A        assertTrue(s3.doesBucketExist(bucketNamePrefix + instanceId));%0A    %7D%0A%0A    @Override%0A    public void case5_removeInstanceSucceedsWithCredentials() throws Exception %7B%0A        super.case5_removeInstanceSucceedsWithCredentials();%0A        assertFalse(s3.doesBucketExist(bucketNamePrefix + instanceId));%0A    %7D
 %0A%7D%0A

add simple S3 test upon service creation