@@ -312,4 +312,53 @@ public void testToBuilder() {
312
312
Blob simpleBlob = new Blob (storage , new BlobInfo .BuilderImpl (BLOB_INFO ));
313
313
assertEquals (simpleBlob , simpleBlob .toBuilder ().build ());
314
314
}
315
+
316
+ @ Test
317
+ public void testBuilder () {
318
+ initializeExpectedBlob (4 );
319
+ expect (storage .options ()).andReturn (mockOptions ).times (2 );
320
+ replay (storage );
321
+ Blob .Builder builder = new Blob .Builder (new Blob (storage , new BlobInfo .BuilderImpl (BLOB_INFO )));
322
+ Blob blob = builder .acl (ACL )
323
+ .componentCount (COMPONENT_COUNT )
324
+ .contentType (CONTENT_TYPE )
325
+ .cacheControl (CACHE_CONTROL )
326
+ .contentDisposition (CONTENT_DISPOSITION )
327
+ .contentEncoding (CONTENT_ENCODING )
328
+ .contentLanguage (CONTENT_LANGUAGE )
329
+ .crc32c (CRC32 )
330
+ .deleteTime (DELETE_TIME )
331
+ .etag (ETAG )
332
+ .id (ID )
333
+ .md5 (MD5 )
334
+ .mediaLink (MEDIA_LINK )
335
+ .metadata (METADATA )
336
+ .metageneration (META_GENERATION )
337
+ .owner (OWNER )
338
+ .selfLink (SELF_LINK )
339
+ .size (SIZE )
340
+ .updateTime (UPDATE_TIME )
341
+ .build ();
342
+ assertEquals ("b" , blob .bucket ());
343
+ assertEquals ("n" , blob .name ());
344
+ assertEquals (ACL , blob .acl ());
345
+ assertEquals (COMPONENT_COUNT , blob .componentCount ());
346
+ assertEquals (CONTENT_TYPE , blob .contentType ());
347
+ assertEquals (CACHE_CONTROL , blob .cacheControl ());
348
+ assertEquals (CONTENT_DISPOSITION , blob .contentDisposition ());
349
+ assertEquals (CONTENT_ENCODING , blob .contentEncoding ());
350
+ assertEquals (CONTENT_LANGUAGE , blob .contentLanguage ());
351
+ assertEquals (CRC32 , blob .crc32c ());
352
+ assertEquals (DELETE_TIME , blob .deleteTime ());
353
+ assertEquals (ETAG , blob .etag ());
354
+ assertEquals (ID , blob .id ());
355
+ assertEquals (MD5 , blob .md5 ());
356
+ assertEquals (MEDIA_LINK , blob .mediaLink ());
357
+ assertEquals (METADATA , blob .metadata ());
358
+ assertEquals (META_GENERATION , blob .metageneration ());
359
+ assertEquals (OWNER , blob .owner ());
360
+ assertEquals (SELF_LINK , blob .selfLink ());
361
+ assertEquals (SIZE , blob .size ());
362
+ assertEquals (UPDATE_TIME , blob .updateTime ());
363
+ }
315
364
}
0 commit comments