From 327a7b0a6be5c75384a598cd9636b5f7247a3546 Mon Sep 17 00:00:00 2001 From: "Roman C. Coedo" Date: Thu, 3 Jul 2014 23:50:20 +0200 Subject: [PATCH] Use assertj extraction feature to shorten test --- .../java/org/jclouds/glacier/GlacierClientLiveTest.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apis/glacier/src/test/java/org/jclouds/glacier/GlacierClientLiveTest.java b/apis/glacier/src/test/java/org/jclouds/glacier/GlacierClientLiveTest.java index 34750e90f2..dc2fdd62a2 100644 --- a/apis/glacier/src/test/java/org/jclouds/glacier/GlacierClientLiveTest.java +++ b/apis/glacier/src/test/java/org/jclouds/glacier/GlacierClientLiveTest.java @@ -23,8 +23,6 @@ import static org.jclouds.glacier.util.TestUtils.buildPayload; 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 class GlacierClientLiveTest extends BaseApiLiveTest{ try { assertThat(api.uploadPart(VAULT_NAME1, uploadId, ContentRange.fromPartNumber(0, partSizeInMb), buildPayload(partSizeInMb * MiB))).isNotNull(); - PaginatedMultipartUploadCollection uploads = api.listMultipartUploads(VAULT_NAME1); - ImmutableList.Builder 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);