/*
 * Copyright 2015 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.gcloud.storage;

import com.google.gcloud.storage.BatchRequest.Builder;
import com.google.gcloud.storage.StorageService.BlobSourceOption;

import org.junit.Test;

public class BatchRequestTest {

  @Test
  public void testRequest() throws Exception {
    Builder builder = BatchRequest.builder();
    builder.delete("b1", "o1")
    BatchRequest.builder().delete("b1", "o1",
        BlobSourceOption.generationMatch(), BlobSourceOption.metagenerationMatch());
  }

  @Test
  public void testToUpdate() throws Exception {

  }

  @Test
  public void testToGet() throws Exception {

  }

  @Test
  public void testBuilder() throws Exception {

  }
}

@@ -647,32 +647,39 @@
 torage;%0A%0Aimport 
+static 
 com.google.gclou
@@ -692,118 +692,445 @@
 age.
-BatchRequest.Builder;%0Aimport com.google.gcloud.storage.StorageService.BlobSourceOption;%0A%0Aimport org.junit.Test
+StorageService.PredefinedAcl.PUBLIC_READ;%0Aimport static junit.framework.TestCase.assertFalse;%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0A%0Aimport com.google.common.collect.Iterables;%0Aimport com.google.gcloud.storage.StorageService.BlobSourceOption;%0Aimport com.google.gcloud.storage.StorageService.BlobTargetOption;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.Iterator;%0Aimport java.util.Map.Entry
 ;%0A%0Ap
@@ -1225,22 +1225,27 @@
    B
-uilder builder
+atchRequest request
  = B
@@ -1269,21 +1269,17 @@
 er()
-;
 %0A    
-builder
+    
 .del
@@ -1298,38 +1298,20 @@
 1%22)%0A    
-BatchRequest.builder()
+    
 .delete(
@@ -1322,19 +1322,11 @@
 , %22o
-1
+2
 %22,
-%0A       
  Blo
@@ -1359,10 +1359,23 @@
 tch(
+1
 ),
+%0A           
  Blo
@@ -1412,192 +1412,1204 @@
 tch(
+2
 ))
-;
 %0A  
-%7D%0A%0A  @Test%0A  public void testToUpdate() throws Ex
+      .update(Blob.of(%22b2%22, %22o1%22), BlobTargetOption.predefinedAcl(PUBLIC_READ))%0A        .update(Blob.of(%22b2%22, %22o2%22))%0A        .get(%22b3%22, %22o1%22)%0A        .get(%22b3%22, %22o2%22, BlobSourceOption.generationMatch(1))%0A        .get(%22b3%22, %22o3%22)%0A        .build();%0A%0A    Iterator%3CEntry%3CBlob, Iterable%3CBlobSourceOption%3E%3E%3E deletes = request%0A        .toDelete().entrySet().iterator();%0A    Entry%3CBlob, Iterable%3CBlobSour
 ce
+O
 ption
- %7B%0A%0A  %7D%0A%0A  @Test%0A  public void testToG
+%3E%3E delete = deletes.next();%0A    assertEquals(Blob.of(%22b1%22, %22o1%22), delete.getKey());%0A    assertTrue(Iterables.isEmpty(delete.getValue()));%0A    delete = deletes.next();%0A    assertEquals(Blob.of(%22b1%22, %22o2%22), delete.getKey());%0A    assertEquals(2, Iterables.size(delete.getValue()));%0A    assertFalse(deletes.hasNext());%0A%0A    Iterator%3CEntry%3CBlob, Iterable%3CBlobSourceOption%3E%3E%3E updates = request%0A        .toDel
 et
+e
 ()
- throws Ex
+.entrySet().iterator();%0A    Entry%3CBlob, Iterable%3CBlobSour
 ce
+O
 ption
- %7B%0A%0A  %7D%0A%0A  @Test%0A  public void testBuilder() throws Exception %7B
+%3E%3E update = updates.next();%0A    assertEquals(Blob.of(%22b1%22, %22o1%22), update.getKey());%0A    assertTrue(Iterables.isEmpty(update.getValue()));%0A    update = updates.next();%0A    assertEquals(Blob.of(%22b1%22, %22o2%22), update.getKey());%0A    assertEquals(2, Iterables.size(update.getValue()));%0A    assertFalse(updates.hasNext());
 %0A%0A  

work in progress