Skip to content

Commit

Permalink
Merge pull request #44 from aozarov/master
Browse files Browse the repository at this point in the history
fix build
  • Loading branch information
aozarov committed May 7, 2015
2 parents d4368c5 + 425ae6f commit 078dd09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/google/gcloud/storage/StorageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,4 +425,6 @@ public static Builder builder() {
* @throws StorageServiceException upon failure
*/
BlobWriteChannel writer(Blob blob, BlobTargetOption... options);


}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.google.gcloud.datastore.StructuredQuery.PropertyFilter;
import com.google.gcloud.spi.DatastoreRpc;
import com.google.gcloud.spi.DatastoreRpc.DatastoreRpcException.Reason;
import com.google.gcloud.spi.DatastoreRpcFactory;

import org.easymock.EasyMock;
import org.junit.AfterClass;
Expand Down Expand Up @@ -637,18 +638,21 @@ public void testRetires() throws Exception {
DatastoreV1.LookupRequest.newBuilder().addKey(KEY1.toPb()).build();
DatastoreV1.LookupResponse responsePb = DatastoreV1.LookupResponse.newBuilder()
.addFound(EntityResult.newBuilder().setEntity(ENTITY1.toPb())).build();
DatastoreRpc mock = EasyMock.createStrictMock(DatastoreRpc.class);
EasyMock.expect(mock.lookup(requestPb))
DatastoreRpcFactory rpcFactoryMock = EasyMock.createStrictMock(DatastoreRpcFactory.class);
DatastoreRpc rpcMock = EasyMock.createStrictMock(DatastoreRpc.class);
EasyMock.expect(rpcFactoryMock.create(EasyMock.anyObject(DatastoreServiceOptions.class)))
.andReturn(rpcMock);
EasyMock.expect(rpcMock.lookup(requestPb))
.andThrow(new DatastoreRpc.DatastoreRpcException(Reason.UNAVAILABLE))
.andReturn(responsePb);
EasyMock.replay(mock);
EasyMock.replay(rpcFactoryMock, rpcMock);
DatastoreServiceOptions options = this.options.toBuilder()
.retryParams(RetryParams.getDefaultInstance())
.datastoreRpc(mock)
.serviceRpcFactory(rpcFactoryMock)
.build();
DatastoreService datastore = DatastoreServiceFactory.instance().get(options);
Entity entity = datastore.get(KEY1);
assertEquals(ENTITY1, entity);
EasyMock.verify(mock);
EasyMock.verify(rpcFactoryMock, rpcMock);
}
}

0 comments on commit 078dd09

Please sign in to comment.