}
@Test
public void vanillaBatchGetItemTest() throws Exception {
this.vanillaBatchWriteItemTest();
BatchGetItemRequest batchGetItemRequest = new BatchGetItemRequest();
Map<String, KeysAndAttributes> requestItems = new HashMap<String, KeysAndAttributes>();
KeysAndAttributes keysAndAttributes1 = new KeysAndAttributes();
List<Map<String, AttributeValue>> itemKeys1 = new ArrayList<Map<String, AttributeValue>>();
itemKeys1.add(createItemKey(hashKeyName1, new AttributeValue().withN("6")));
keysAndAttributes1.setKeys(itemKeys1);
List<String> attributesToGet1 = new ArrayList<String>();
attributesToGet1.add(hashKeyName1);
keysAndAttributes1.setAttributesToGet(attributesToGet1);
KeysAndAttributes keysAndAttributes2 = new KeysAndAttributes();
List<Map<String, AttributeValue>> itemKeys2 = new ArrayList<Map<String, AttributeValue>>();
itemKeys2.add(createItemKey(hashKeyName2, new AttributeValue().withN("1")));
keysAndAttributes2.setKeys(itemKeys2);
List<String> attributesToGet2 = new ArrayList<String>();
attributesToGet2.add(hashKeyName2);
keysAndAttributes2.setAttributesToGet(attributesToGet2);
//Test case 1: Every request has matches.
// keys.add(new Key(new AttributeValue("4")));
// keys.add(new Key(new AttributeValue("5")));
// keys.add(new Key(new AttributeValue("3")));
//Test case 2: Requests has no match.
//Test case 3: Complicated test, some requests has matches, some doesn't.
// keys.add(new Key(new AttributeValue("7")));
// keys.add(new Key(new AttributeValue("4")));
//Test case 4: Duplicated request
//Duplicated requests return duplicated results.
// keys.add(new Key(new AttributeValue("7")));
// keys.add(new Key(new AttributeValue("7")));
// keys.add(new Key(new AttributeValue("4")));
// keys.add(new Key(new AttributeValue("4")));
//Test case for Exception: Table doesn't exist.
// requestItems.put("Vito's Table", keysAndAttributes);
// Normal test
// TODO: Multi table test failed. Need to be fixed.
requestItems.put(tableName1, keysAndAttributes1);
requestItems.put(tableName2, keysAndAttributes2);
batchGetItemRequest.withRequestItems(requestItems);
BatchGetItemResult result = getClient().batchGetItem(batchGetItemRequest);
junit.framework.Assert.assertNotNull("UnprocessedKeys should be empty rather than null.", result.getUnprocessedKeys());
}