Skip to content

Commit 6cd1040

Browse files
committed
Apply feedback
1 parent 41bb953 commit 6cd1040

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/MockAmazonS3.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public boolean doesObjectExist(final String bucketName, final String objectName)
8787

8888
@Override
8989
public PutObjectResult putObject(final PutObjectRequest request) throws AmazonClientException {
90-
assertThat(request.getBucketName(), equalTo(bucket));
9190
assertThat(request.getBucketName(), equalTo(bucket));
9291
assertThat(request.getMetadata().getSSEAlgorithm(), serverSideEncryption ? equalTo("AES256") : nullValue());
9392
assertThat(request.getCannedAcl(), notNullValue());
@@ -185,7 +184,7 @@ public DeleteObjectsResult deleteObjects(DeleteObjectsRequest request) throws Sd
185184

186185
final List<DeleteObjectsResult.DeletedObject> deletions = new ArrayList<>();
187186
for (DeleteObjectsRequest.KeyVersion key : request.getKeys()) {
188-
if(blobs.remove(key.getKey()) == null){
187+
if (blobs.remove(key.getKey()) == null) {
189188
AmazonS3Exception exception = new AmazonS3Exception("[" + key + "] does not exist.");
190189
exception.setStatusCode(404);
191190
throw exception;

plugins/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobStoreRepositoryTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.elasticsearch.plugins.Plugin;
3030
import org.elasticsearch.repositories.Repository;
3131
import org.elasticsearch.repositories.blobstore.ESBlobStoreRepositoryIntegTestCase;
32+
import org.junit.AfterClass;
3233
import org.junit.BeforeClass;
3334

3435
import java.util.Collection;
@@ -65,6 +66,11 @@ public static void setUpRepositorySettings() {
6566
}
6667
}
6768

69+
@AfterClass
70+
public static void wipeRepository() {
71+
blobs.clear();
72+
}
73+
6874
@Override
6975
protected void createTestRepository(final String name) {
7076
assertAcked(client().admin().cluster().preparePutRepository(name)

0 commit comments

Comments
 (0)