Skip to content

Commit

Permalink
rename helper method in DatastoreTests and other minor style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajay Kannan committed Oct 23, 2015
1 parent a30b948 commit d4530f6
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,14 @@ public void testGetArrayNoDeferredResults() {
}

public void testGetArrayDeferredResults() throws DatastoreRpcException {
Set<Key> requestedKeys = new HashSet<Key>();
Set<Key> requestedKeys = new HashSet<>();
requestedKeys.add(KEY1);
requestedKeys.add(KEY2);
requestedKeys.add(KEY3);
requestedKeys.add(KEY4);
requestedKeys.add(KEY5);
Iterator<Entity> iter =
createMockDatastoreForDeferredLookup().get(KEY1, KEY2, KEY3, KEY4, KEY5);
Set<Key> keysOfFoundEntities = new HashSet<Key>();
Iterator<Entity> iter = createDatastoreForDeferredLookup().get(KEY1, KEY2, KEY3, KEY4, KEY5);
Set<Key> keysOfFoundEntities = new HashSet<>();
while (iter.hasNext()) {
keysOfFoundEntities.add(iter.next().key());
}
Expand All @@ -570,7 +569,7 @@ public void testGetArrayDeferredResults() throws DatastoreRpcException {

public void testFetchArrayDeferredResults() throws DatastoreRpcException {
List<Entity> foundEntities =
createMockDatastoreForDeferredLookup().fetch(KEY1, KEY2, KEY3, KEY4, KEY5);
createDatastoreForDeferredLookup().fetch(KEY1, KEY2, KEY3, KEY4, KEY5);
assertEquals(foundEntities.get(0).key(), KEY1);
assertEquals(foundEntities.get(1).key(), KEY2);
assertEquals(foundEntities.get(2).key(), KEY3);
Expand All @@ -579,7 +578,7 @@ public void testFetchArrayDeferredResults() throws DatastoreRpcException {
assertEquals(foundEntities.size(), 5);
}

private Datastore createMockDatastoreForDeferredLookup() throws DatastoreRpcException {
private Datastore createDatastoreForDeferredLookup() throws DatastoreRpcException {
List<DatastoreV1.Key> keysPb = new ArrayList<>();
keysPb.add(KEY1.toPb());
keysPb.add(KEY2.toPb());
Expand Down

0 comments on commit d4530f6

Please sign in to comment.