From 1ab0ac5106b384f90868b726be933230fefab4cd Mon Sep 17 00:00:00 2001 From: Marco Ziccardi Date: Fri, 8 Jan 2016 12:23:35 +0100 Subject: [PATCH] Rename load to get in functional classes --- README.md | 2 +- .../com/google/gcloud/bigquery/Dataset.java | 4 +- .../java/com/google/gcloud/bigquery/Job.java | 4 +- .../com/google/gcloud/bigquery/Table.java | 8 ++-- .../google/gcloud/bigquery/DatasetTest.java | 12 +++--- .../com/google/gcloud/bigquery/JobTest.java | 12 +++--- .../com/google/gcloud/bigquery/TableTest.java | 24 +++++------ .../gcloud/examples/StorageExample.java | 12 +++--- .../gcloud/resourcemanager/Project.java | 6 +-- .../gcloud/resourcemanager/ProjectTest.java | 6 +-- .../java/com/google/gcloud/storage/Blob.java | 43 ++++++++++++++----- .../com/google/gcloud/storage/Bucket.java | 4 +- .../google/gcloud/storage/package-info.java | 2 +- .../com/google/gcloud/storage/BlobTest.java | 40 +++++++++-------- .../com/google/gcloud/storage/BucketTest.java | 12 +++--- 15 files changed, 110 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index e3c810b200f2..7aab454137b4 100644 --- a/README.md +++ b/README.md @@ -250,7 +250,7 @@ import java.nio.channels.WritableByteChannel; Storage storage = StorageOptions.defaultInstance().service(); BlobId blobId = BlobId.of("bucket", "blob_name"); -Blob blob = Blob.load(storage, blobId); +Blob blob = Blob.get(storage, blobId); if (blob == null) { BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build(); storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8)); diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java index d3db421619c4..facf5e659f99 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Dataset.java @@ -131,7 +131,7 @@ public Dataset(BigQuery bigquery, DatasetInfo info) { * @return the {@code Dataset} object or {@code null} if not found * @throws BigQueryException upon failure */ - public static Dataset load(BigQuery bigquery, String dataset, BigQuery.DatasetOption... options) { + public static Dataset get(BigQuery bigquery, String dataset, BigQuery.DatasetOption... options) { DatasetInfo info = bigquery.getDataset(dataset, options); return info != null ? new Dataset(bigquery, info) : null; } @@ -162,7 +162,7 @@ public boolean exists() { * @throws BigQueryException upon failure */ public Dataset reload(BigQuery.DatasetOption... options) { - return Dataset.load(bigquery, info.datasetId().dataset(), options); + return Dataset.get(bigquery, info.datasetId().dataset(), options); } /** diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java index e6de2a9d7a4a..c0d7ddc29c37 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Job.java @@ -52,7 +52,7 @@ public Job(BigQuery bigquery, JobInfo info) { * @return the {@code Job} object or {@code null} if not found * @throws BigQueryException upon failure */ - public static Job load(BigQuery bigquery, String job, BigQuery.JobOption... options) { + public static Job get(BigQuery bigquery, String job, BigQuery.JobOption... options) { JobInfo info = bigquery.getJob(job, options); return info != null ? new Job(bigquery, info) : null; } @@ -103,7 +103,7 @@ public boolean isDone() { * @throws BigQueryException upon failure */ public Job reload(BigQuery.JobOption... options) { - return Job.load(bigquery, info.jobId().job(), options); + return Job.get(bigquery, info.jobId().job(), options); } /** diff --git a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java index fd9a96e132b6..1662f266b5ec 100644 --- a/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java +++ b/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/Table.java @@ -61,9 +61,9 @@ public Table(BigQuery bigquery, BaseTableInfo info) { * @return the {@code Table} object or {@code null} if not found * @throws BigQueryException upon failure */ - public static Table load(BigQuery bigquery, String dataset, String table, + public static Table get(BigQuery bigquery, String dataset, String table, BigQuery.TableOption... options) { - return load(bigquery, TableId.of(dataset, table), options); + return get(bigquery, TableId.of(dataset, table), options); } /** @@ -76,7 +76,7 @@ public static Table load(BigQuery bigquery, String dataset, String table, * @return the {@code Table} object or {@code null} if not found * @throws BigQueryException upon failure */ - public static Table load(BigQuery bigquery, TableId table, BigQuery.TableOption... options) { + public static Table get(BigQuery bigquery, TableId table, BigQuery.TableOption... options) { BaseTableInfo info = bigquery.getTable(table, options); return info != null ? new Table(bigquery, info) : null; } @@ -106,7 +106,7 @@ public boolean exists() { * @throws BigQueryException upon failure */ public Table reload(BigQuery.TableOption... options) { - return Table.load(bigquery, info.tableId(), options); + return Table.get(bigquery, info.tableId(), options); } /** diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java index 05be4df39773..544fc2378b23 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/DatasetTest.java @@ -304,27 +304,27 @@ public void testCreateExternalTableWithOptions() throws Exception { } @Test - public void testLoad() throws Exception { + public void testStaticGet() throws Exception { expect(bigquery.getDataset(DATASET_INFO.datasetId().dataset())).andReturn(DATASET_INFO); replay(bigquery); - Dataset loadedDataset = Dataset.load(bigquery, DATASET_INFO.datasetId().dataset()); + Dataset loadedDataset = Dataset.get(bigquery, DATASET_INFO.datasetId().dataset()); assertNotNull(loadedDataset); assertEquals(DATASET_INFO, loadedDataset.info()); } @Test - public void testLoadNull() throws Exception { + public void testStaticGetNull() throws Exception { expect(bigquery.getDataset(DATASET_INFO.datasetId().dataset())).andReturn(null); replay(bigquery); - assertNull(Dataset.load(bigquery, DATASET_INFO.datasetId().dataset())); + assertNull(Dataset.get(bigquery, DATASET_INFO.datasetId().dataset())); } @Test - public void testLoadWithOptions() throws Exception { + public void testStaticGetWithOptions() throws Exception { expect(bigquery.getDataset(DATASET_INFO.datasetId().dataset(), BigQuery.DatasetOption.fields())) .andReturn(DATASET_INFO); replay(bigquery); - Dataset loadedDataset = Dataset.load(bigquery, DATASET_INFO.datasetId().dataset(), + Dataset loadedDataset = Dataset.get(bigquery, DATASET_INFO.datasetId().dataset(), BigQuery.DatasetOption.fields()); assertNotNull(loadedDataset); assertEquals(DATASET_INFO, loadedDataset.info()); diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java index d99176b6904c..6a5cef6508cc 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/JobTest.java @@ -148,27 +148,27 @@ public void testCancel() throws Exception { } @Test - public void testLoad() throws Exception { + public void testGet() throws Exception { expect(bigquery.getJob(JOB_INFO.jobId().job())).andReturn(JOB_INFO); replay(bigquery); - Job loadedJob = Job.load(bigquery, JOB_INFO.jobId().job()); + Job loadedJob = Job.get(bigquery, JOB_INFO.jobId().job()); assertNotNull(loadedJob); assertEquals(JOB_INFO, loadedJob.info()); } @Test - public void testLoadNull() throws Exception { + public void testGetNull() throws Exception { expect(bigquery.getJob(JOB_INFO.jobId().job())).andReturn(null); replay(bigquery); - assertNull(Job.load(bigquery, JOB_INFO.jobId().job())); + assertNull(Job.get(bigquery, JOB_INFO.jobId().job())); } @Test - public void testLoadWithOptions() throws Exception { + public void testGetWithOptions() throws Exception { expect(bigquery.getJob(JOB_INFO.jobId().job(), BigQuery.JobOption.fields())) .andReturn(JOB_INFO); replay(bigquery); - Job loadedJob = Job.load(bigquery, JOB_INFO.jobId().job(), BigQuery.JobOption.fields()); + Job loadedJob = Job.get(bigquery, JOB_INFO.jobId().job(), BigQuery.JobOption.fields()); assertNotNull(loadedJob); assertEquals(JOB_INFO, loadedJob.info()); } diff --git a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java index e5b152a91a5f..dfcf17c90ab3 100644 --- a/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java +++ b/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/TableTest.java @@ -292,54 +292,54 @@ public void testExtractDataUris() throws Exception { } @Test - public void testLoadFromId() throws Exception { + public void testGetFromId() throws Exception { expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(TABLE_INFO); replay(bigquery); - Table loadedTable = Table.load(bigquery, TABLE_INFO.tableId()); + Table loadedTable = Table.get(bigquery, TABLE_INFO.tableId()); assertNotNull(loadedTable); assertEquals(TABLE_INFO, loadedTable.info()); } @Test - public void testLoadFromStrings() throws Exception { + public void testGetFromStrings() throws Exception { expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(TABLE_INFO); replay(bigquery); - Table loadedTable = Table.load(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table()); + Table loadedTable = Table.get(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table()); assertNotNull(loadedTable); assertEquals(TABLE_INFO, loadedTable.info()); } @Test - public void testLoadFromIdNull() throws Exception { + public void testGetFromIdNull() throws Exception { expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(null); replay(bigquery); - assertNull(Table.load(bigquery, TABLE_INFO.tableId())); + assertNull(Table.get(bigquery, TABLE_INFO.tableId())); } @Test - public void testLoadFromStringsNull() throws Exception { + public void testGetFromStringsNull() throws Exception { expect(bigquery.getTable(TABLE_INFO.tableId())).andReturn(null); replay(bigquery); - assertNull(Table.load(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table())); + assertNull(Table.get(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table())); } @Test - public void testLoadFromIdWithOptions() throws Exception { + public void testGetFromIdWithOptions() throws Exception { expect(bigquery.getTable(TABLE_INFO.tableId(), BigQuery.TableOption.fields())) .andReturn(TABLE_INFO); replay(bigquery); - Table loadedTable = Table.load(bigquery, TABLE_INFO.tableId(), BigQuery.TableOption.fields()); + Table loadedTable = Table.get(bigquery, TABLE_INFO.tableId(), BigQuery.TableOption.fields()); assertNotNull(loadedTable); assertEquals(TABLE_INFO, loadedTable.info()); } @Test - public void testLoadFromStringsWithOptions() throws Exception { + public void testGetFromStringsWithOptions() throws Exception { expect(bigquery.getTable(TABLE_INFO.tableId(), BigQuery.TableOption.fields())) .andReturn(TABLE_INFO); replay(bigquery); Table loadedTable = - Table.load(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table(), BigQuery.TableOption.fields()); + Table.get(bigquery, TABLE_ID1.dataset(), TABLE_ID1.table(), BigQuery.TableOption.fields()); assertNotNull(loadedTable); assertEquals(TABLE_INFO, loadedTable.info()); } diff --git a/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java b/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java index 3ef8f8b4cc32..a6f65ec705e4 100644 --- a/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java +++ b/gcloud-java-examples/src/main/java/com/google/gcloud/examples/StorageExample.java @@ -134,7 +134,7 @@ public void run(Storage storage, BlobId... blobIds) { if (blobIds.length == 1) { if (blobIds[0].name().isEmpty()) { // get Bucket - Bucket bucket = Bucket.load(storage, blobIds[0].bucket()); + Bucket bucket = Bucket.get(storage, blobIds[0].bucket()); if (bucket == null) { System.out.println("No such bucket"); return; @@ -142,7 +142,7 @@ public void run(Storage storage, BlobId... blobIds) { System.out.println("Bucket info: " + bucket.info()); } else { // get Blob - Blob blob = Blob.load(storage, blobIds[0]); + Blob blob = Blob.get(storage, blobIds[0]); if (blob == null) { System.out.println("No such object"); return; @@ -151,7 +151,7 @@ public void run(Storage storage, BlobId... blobIds) { } } else { // use batch to get multiple blobs. - List blobs = Blob.get(storage, blobIds); + List blobs = Blob.get(storage, Arrays.asList(blobIds)); for (Blob blob : blobs) { if (blob != null) { System.out.println(blob.info()); @@ -225,7 +225,7 @@ public void run(Storage storage, String bucketName) { } } else { // list a bucket's blobs - Bucket bucket = Bucket.load(storage, bucketName); + Bucket bucket = Bucket.get(storage, bucketName); if (bucket == null) { System.out.println("No such bucket"); return; @@ -312,7 +312,7 @@ public void run(Storage storage, Tuple tuple) throws IOException { } private void run(Storage storage, BlobId blobId, Path downloadTo) throws IOException { - Blob blob = Blob.load(storage, blobId); + Blob blob = Blob.get(storage, blobId); if (blob == null) { System.out.println("No such object"); return; @@ -439,7 +439,7 @@ public void run(Storage storage, Tuple> tuple) } private void run(Storage storage, BlobId blobId, Map metadata) { - Blob blob = Blob.load(storage, blobId); + Blob blob = Blob.get(storage, blobId); if (blob == null) { System.out.println("No such object"); return; diff --git a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java index a3ff354b4a53..e329e1aa3714 100644 --- a/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java +++ b/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java @@ -40,12 +40,12 @@ public Project(ResourceManager resourceManager, ProjectInfo projectInfo) { } /** - * Constructs a Project object that contains project information loaded from the server. + * Constructs a Project object that contains project information got from the server. * * @return Project object containing the project's metadata or {@code null} if not found * @throws ResourceManagerException upon failure */ - public static Project load(ResourceManager resourceManager, String projectId) { + public static Project get(ResourceManager resourceManager, String projectId) { ProjectInfo projectInfo = resourceManager.get(projectId); return projectInfo != null ? new Project(resourceManager, projectInfo) : null; } @@ -72,7 +72,7 @@ public ResourceManager resourceManager() { * @throws ResourceManagerException upon failure */ public Project reload() { - return Project.load(resourceManager, info.projectId()); + return Project.get(resourceManager, info.projectId()); } /** diff --git a/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java b/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java index 5d765d20c313..077818bf2bb9 100644 --- a/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java +++ b/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java @@ -66,7 +66,7 @@ public void tearDown() throws Exception { public void testLoad() { expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(PROJECT_INFO); replay(resourceManager); - Project loadedProject = Project.load(resourceManager, PROJECT_INFO.projectId()); + Project loadedProject = Project.get(resourceManager, PROJECT_INFO.projectId()); assertEquals(PROJECT_INFO, loadedProject.info()); } @@ -84,7 +84,7 @@ public void testReload() { public void testLoadNull() { expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(null); replay(resourceManager); - assertNull(Project.load(resourceManager, PROJECT_INFO.projectId())); + assertNull(Project.get(resourceManager, PROJECT_INFO.projectId())); } @Test @@ -92,7 +92,7 @@ public void testReloadDeletedProject() { expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(PROJECT_INFO); expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(null); replay(resourceManager); - Project loadedProject = Project.load(resourceManager, PROJECT_INFO.projectId()); + Project loadedProject = Project.get(resourceManager, PROJECT_INFO.projectId()); assertNotNull(loadedProject); Project reloadedProject = loadedProject.reload(); assertNull(reloadedProject); diff --git a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Blob.java b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Blob.java index b85cbba7d869..5b305d15cee4 100644 --- a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Blob.java +++ b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Blob.java @@ -22,6 +22,7 @@ import static com.google.gcloud.storage.Blob.BlobSourceOption.toSourceOptions; import com.google.common.base.Function; +import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import com.google.gcloud.spi.StorageRpc; import com.google.gcloud.storage.Storage.BlobTargetOption; @@ -165,9 +166,9 @@ public Blob(Storage storage, BlobInfo info) { * @return the {@code Blob} object or {@code null} if not found * @throws StorageException upon failure */ - public static Blob load(Storage storage, String bucket, String blob, + public static Blob get(Storage storage, String bucket, String blob, Storage.BlobGetOption... options) { - return load(storage, BlobId.of(bucket, blob), options); + return get(storage, BlobId.of(bucket, blob), options); } /** @@ -180,7 +181,7 @@ public static Blob load(Storage storage, String bucket, String blob, * @return the {@code Blob} object or {@code null} if not found * @throws StorageException upon failure */ - public static Blob load(Storage storage, BlobId blobId, Storage.BlobGetOption... options) { + public static Blob get(Storage storage, BlobId blobId, Storage.BlobGetOption... options) { BlobInfo info = storage.get(blobId, options); return info != null ? new Blob(storage, info) : null; } @@ -231,7 +232,7 @@ public byte[] content(Storage.BlobSourceOption... options) { * @throws StorageException upon failure */ public Blob reload(BlobSourceOption... options) { - return Blob.load(storage, info.blobId(), toGetOptions(info, options)); + return Blob.get(storage, info.blobId(), toGetOptions(info, options)); } /** @@ -369,18 +370,40 @@ public Storage storage() { * Gets the requested blobs. A batch request is used to fetch blobs. * * @param storage the storage service used to issue the request - * @param blobs the blobs to get + * @param first the first blob to get + * @param second the second blob to get + * @param other other blobs to get * @return an immutable list of {@code Blob} objects. If a blob does not exist or access to it has * been denied the corresponding item in the list is {@code null} * @throws StorageException upon failure */ - public static List get(final Storage storage, BlobId... blobs) { + public static List get(Storage storage, BlobId first, BlobId second, BlobId... other) { + checkNotNull(storage); + checkNotNull(first); + checkNotNull(second); + checkNotNull(other); + ImmutableList blobs = ImmutableList.builder() + .add(first) + .add(second) + .addAll(Arrays.asList(other)) + .build(); + return get(storage, blobs); + } + + /** + * Gets the requested blobs. A batch request is used to fetch blobs. + * + * @param storage the storage service used to issue the request + * @param blobs list of blobs to get + * @return an immutable list of {@code Blob} objects. If a blob does not exist or access to it has + * been denied the corresponding item in the list is {@code null} + * @throws StorageException upon failure + */ + public static List get(final Storage storage, List blobs) { checkNotNull(storage); checkNotNull(blobs); - if (blobs.length == 0) { - return Collections.emptyList(); - } - return Collections.unmodifiableList(Lists.transform(storage.get(blobs), + BlobId[] blobArray = blobs.toArray(new BlobId[blobs.size()]); + return Collections.unmodifiableList(Lists.transform(storage.get(blobArray), new Function() { @Override public Blob apply(BlobInfo blobInfo) { diff --git a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Bucket.java b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Bucket.java index 61ff1ec9d0a3..d0e823492ee3 100644 --- a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Bucket.java +++ b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/Bucket.java @@ -214,7 +214,7 @@ public Bucket(Storage storage, BucketInfo info) { * @return the {@code Bucket} object or {@code null} if not found * @throws StorageException upon failure */ - public static Bucket load(Storage storage, String bucket, Storage.BucketGetOption... options) { + public static Bucket get(Storage storage, String bucket, Storage.BucketGetOption... options) { BucketInfo info = storage.get(bucket, options); return info != null ? new Bucket(storage, info) : null; } @@ -247,7 +247,7 @@ public boolean exists(BucketSourceOption... options) { * @throws StorageException upon failure */ public Bucket reload(BucketSourceOption... options) { - return Bucket.load(storage, info.name(), toGetOptions(info, options)); + return Bucket.get(storage, info.name(), toGetOptions(info, options)); } /** diff --git a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java index 7938a0094419..fda14ea2e808 100644 --- a/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java +++ b/gcloud-java-storage/src/main/java/com/google/gcloud/storage/package-info.java @@ -21,7 +21,7 @@ *
 {@code
  * Storage storage = StorageOptions.defaultInstance().service();
  * BlobId blobId = BlobId.of("bucket", "blob_name");
- * Blob blob = Blob.load(storage, blobId);
+ * Blob blob = Blob.get(storage, blobId);
  * if (blob == null) {
  *   BlobInfo blobInfo = BlobInfo.builder(blobId).contentType("text/plain").build();
  *   storage.create(blobInfo, "Hello, Cloud Storage!".getBytes(UTF_8));
diff --git a/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobTest.java b/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobTest.java
index 45cf79e01278..bc6a4725d7e7 100644
--- a/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobTest.java
+++ b/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BlobTest.java
@@ -211,17 +211,23 @@ public void testSignUrl() throws Exception {
   }
 
   @Test
-  public void testGetNone() throws Exception {
+  public void testGetSome() throws Exception {
+    List blobInfoList = Arrays.asList(BLOB_INFO_ARRAY);
+    expect(storage.get(BLOB_ID_ARRAY)).andReturn(blobInfoList);
     replay(storage);
-    assertTrue(Blob.get(storage).isEmpty());
+    List result = Blob.get(storage, BLOB_ID_ARRAY[0], BLOB_ID_ARRAY[1], BLOB_ID_ARRAY[2]);
+    assertEquals(blobInfoList.size(), result.size());
+    for (int i = 0; i < blobInfoList.size(); i++) {
+      assertEquals(blobInfoList.get(i), result.get(i).info());
+    }
   }
 
   @Test
-  public void testGetSome() throws Exception {
+  public void testGetSomeList() throws Exception {
     List blobInfoList = Arrays.asList(BLOB_INFO_ARRAY);
     expect(storage.get(BLOB_ID_ARRAY)).andReturn(blobInfoList);
     replay(storage);
-    List result = Blob.get(storage, BLOB_ID_ARRAY);
+    List result = Blob.get(storage, Arrays.asList(BLOB_ID_ARRAY));
     assertEquals(blobInfoList.size(), result.size());
     for (int i = 0; i < blobInfoList.size(); i++) {
       assertEquals(blobInfoList.get(i), result.get(i).info());
@@ -233,7 +239,7 @@ public void testGetSomeNull() throws Exception {
     List blobInfoList = Arrays.asList(BLOB_INFO_ARRAY[0], null, BLOB_INFO_ARRAY[2]);
     expect(storage.get(BLOB_ID_ARRAY)).andReturn(blobInfoList);
     replay(storage);
-    List result = Blob.get(storage, BLOB_ID_ARRAY);
+    List result = Blob.get(storage, BLOB_ID_ARRAY[0], BLOB_ID_ARRAY[1], BLOB_ID_ARRAY[2]);
     assertEquals(blobInfoList.size(), result.size());
     for (int i = 0; i < blobInfoList.size(); i++) {
       if (blobInfoList.get(i) != null) {
@@ -302,53 +308,53 @@ public void testDeleteSome() throws Exception {
   }
 
   @Test
-  public void testLoadFromString() throws Exception {
+  public void testGetFromString() throws Exception {
     expect(storage.get(BLOB_INFO.blobId(), new Storage.BlobGetOption[0])).andReturn(BLOB_INFO);
     replay(storage);
-    Blob loadedBlob = Blob.load(storage, BLOB_INFO.bucket(), BLOB_INFO.name());
+    Blob loadedBlob = Blob.get(storage, BLOB_INFO.bucket(), BLOB_INFO.name());
     assertEquals(BLOB_INFO, loadedBlob.info());
   }
 
   @Test
-  public void testLoadFromId() throws Exception {
+  public void testGetFromId() throws Exception {
     expect(storage.get(BLOB_INFO.blobId(), new Storage.BlobGetOption[0])).andReturn(BLOB_INFO);
     replay(storage);
-    Blob loadedBlob = Blob.load(storage, BLOB_INFO.blobId());
+    Blob loadedBlob = Blob.get(storage, BLOB_INFO.blobId());
     assertNotNull(loadedBlob);
     assertEquals(BLOB_INFO, loadedBlob.info());
   }
 
   @Test
-  public void testLoadFromStringNull() throws Exception {
+  public void testGetFromStringNull() throws Exception {
     expect(storage.get(BLOB_INFO.blobId(), new Storage.BlobGetOption[0])).andReturn(null);
     replay(storage);
-    assertNull(Blob.load(storage, BLOB_INFO.bucket(), BLOB_INFO.name()));
+    assertNull(Blob.get(storage, BLOB_INFO.bucket(), BLOB_INFO.name()));
   }
 
   @Test
-  public void testLoadFromIdNull() throws Exception {
+  public void testGetFromIdNull() throws Exception {
     expect(storage.get(BLOB_INFO.blobId(), new Storage.BlobGetOption[0])).andReturn(null);
     replay(storage);
-    assertNull(Blob.load(storage, BLOB_INFO.blobId()));
+    assertNull(Blob.get(storage, BLOB_INFO.blobId()));
   }
 
   @Test
-  public void testLoadFromStringWithOptions() throws Exception {
+  public void testGetFromStringWithOptions() throws Exception {
     expect(storage.get(BLOB_INFO.blobId(), Storage.BlobGetOption.generationMatch(42L)))
         .andReturn(BLOB_INFO);
     replay(storage);
-    Blob loadedBlob = Blob.load(storage, BLOB_INFO.bucket(), BLOB_INFO.name(),
+    Blob loadedBlob = Blob.get(storage, BLOB_INFO.bucket(), BLOB_INFO.name(),
         Storage.BlobGetOption.generationMatch(42L));
     assertEquals(BLOB_INFO, loadedBlob.info());
   }
 
   @Test
-  public void testLoadFromIdWithOptions() throws Exception {
+  public void testGetFromIdWithOptions() throws Exception {
     expect(storage.get(BLOB_INFO.blobId(), Storage.BlobGetOption.generationMatch(42L)))
         .andReturn(BLOB_INFO);
     replay(storage);
     Blob loadedBlob =
-        Blob.load(storage, BLOB_INFO.blobId(), Storage.BlobGetOption.generationMatch(42L));
+        Blob.get(storage, BLOB_INFO.blobId(), Storage.BlobGetOption.generationMatch(42L));
     assertNotNull(loadedBlob);
     assertEquals(BLOB_INFO, loadedBlob.info());
   }
diff --git a/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BucketTest.java b/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BucketTest.java
index f1644bd8ea37..e67e7aff17dc 100644
--- a/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BucketTest.java
+++ b/gcloud-java-storage/src/test/java/com/google/gcloud/storage/BucketTest.java
@@ -235,28 +235,28 @@ public void testCreateFromStreamNullContentType() throws Exception {
   }
 
   @Test
-  public void testLoad() throws Exception {
+  public void testStaticGet() throws Exception {
     expect(storage.get(BUCKET_INFO.name())).andReturn(BUCKET_INFO);
     replay(storage);
-    Bucket loadedBucket = Bucket.load(storage, BUCKET_INFO.name());
+    Bucket loadedBucket = Bucket.get(storage, BUCKET_INFO.name());
     assertNotNull(loadedBucket);
     assertEquals(BUCKET_INFO, loadedBucket.info());
   }
 
   @Test
-  public void testLoadNull() throws Exception {
+  public void testStaticGetNull() throws Exception {
     expect(storage.get(BUCKET_INFO.name())).andReturn(null);
     replay(storage);
-    assertNull(Bucket.load(storage, BUCKET_INFO.name()));
+    assertNull(Bucket.get(storage, BUCKET_INFO.name()));
   }
 
   @Test
-  public void testLoadWithOptions() throws Exception {
+  public void testStaticGetWithOptions() throws Exception {
     expect(storage.get(BUCKET_INFO.name(), Storage.BucketGetOption.fields()))
         .andReturn(BUCKET_INFO);
     replay(storage);
     Bucket loadedBucket =
-        Bucket.load(storage, BUCKET_INFO.name(), Storage.BucketGetOption.fields());
+        Bucket.get(storage, BUCKET_INFO.name(), Storage.BucketGetOption.fields());
     assertNotNull(loadedBucket);
     assertEquals(BUCKET_INFO, loadedBucket.info());
   }