@Test
public void queryWithHashKeyAndRangeKeyConditionEQTest() {
AttributeValue hashKey = setupTableWithSeveralItems();
QueryRequest request =
new QueryRequest()
.withTableName(tableName)
.withKeyConditions(createHashKeyCondition("id", hashKey))
;
Condition rangeKeyCondition = new Condition();
List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
// attributeValueList.add(new AttributeValue().withN("1"));
attributeValueList.add(createStringAttribute("Range2"));
rangeKeyCondition.setAttributeValueList(attributeValueList);
rangeKeyCondition.setComparisonOperator(ComparisonOperator.EQ);
request.getKeyConditions().put("range", rangeKeyCondition);
QueryResult result = getClient().query(request);
Assert.assertNotNull("Null result.", result);
Assert.assertNotNull("No items returned.", result.getItems());