Skip to content
Permalink
Browse files
Use assertj extraction feature to shorten test
  • Loading branch information
rcoedo authored and gaul committed Jul 3, 2014
1 parent 311de98 commit 2040dc369a72861d5e1b3c46ca2b833c27a2a246
Showing 1 changed file with 1 addition and 8 deletions.
@@ -23,8 +23,6 @@
import java.util.UUID;

import org.jclouds.apis.BaseApiLiveTest;
import org.jclouds.glacier.domain.MultipartUploadMetadata;
import org.jclouds.glacier.domain.PaginatedMultipartUploadCollection;
import org.jclouds.glacier.domain.PaginatedVaultCollection;
import org.jclouds.glacier.util.ContentRange;
import org.testng.annotations.Test;
@@ -96,12 +94,7 @@ public void testListMultipartUploads() throws Exception {
try {
assertThat(api.uploadPart(VAULT_NAME1, uploadId,
ContentRange.fromPartNumber(0, partSizeInMb), buildPayload(partSizeInMb * MiB))).isNotNull();
PaginatedMultipartUploadCollection uploads = api.listMultipartUploads(VAULT_NAME1);
ImmutableList.Builder<String> list = ImmutableList.builder();
for (MultipartUploadMetadata upload : uploads) {
list.add(upload.getMultipartUploadId());
}
assertThat(list.build()).contains(uploadId);
assertThat(api.listMultipartUploads(VAULT_NAME1)).extracting("multipartUploadId").contains(uploadId);
assertThat(api.abortMultipartUpload(VAULT_NAME1, uploadId)).isTrue();
} finally {
api.abortMultipartUpload(VAULT_NAME1, uploadId);

0 comments on commit 2040dc3

Please sign in to comment.