@Override
    public void execute() {
        QueryRequest.Builder query = QueryRequest.builder().tableName(determineTableName())
                .attributesToGet(determineAttributeNames()).consistentRead(determineConsistentRead())
                .keyConditions(determineKeyConditions()).exclusiveStartKey(determineExclusiveStartKey())
                .limit(determineLimit()).scanIndexForward(determineScanIndexForward());

        // Check if we have set an Index Name
        if (exchange.getIn().getHeader(Ddb2Constants.INDEX_NAME, String.class) != null) {
            query.indexName(exchange.getIn().getHeader(Ddb2Constants.INDEX_NAME, String.class));
        }

        QueryResponse result = ddbClient.query(query.build());

        Map<Object, Object> tmp = new HashMap<>();
        tmp.put(Ddb2Constants.ITEMS, result.items());
        tmp.put(Ddb2Constants.LAST_EVALUATED_KEY, result.hasLastEvaluatedKey() ? result.lastEvaluatedKey() : null);
        tmp.put(Ddb2Constants.CONSUMED_CAPACITY, result.consumedCapacity());
        tmp.put(Ddb2Constants.COUNT, result.count());
        addToResults(tmp);
    }
@Test
    public void execute() {

        Map<String, AttributeValue> startKey = new HashMap<>();
        startKey.put("1", AttributeValue.builder().s("startKey").build());

        List<String> attributeNames = Arrays.asList("attrNameOne", "attrNameTwo");
        exchange.getIn().setHeader(Ddb2Constants.ATTRIBUTE_NAMES, attributeNames);
        exchange.getIn().setHeader(Ddb2Constants.CONSISTENT_READ, true);
        exchange.getIn().setHeader(Ddb2Constants.START_KEY, startKey);
        exchange.getIn().setHeader(Ddb2Constants.LIMIT, 10);
        exchange.getIn().setHeader(Ddb2Constants.SCAN_INDEX_FORWARD, true);

        Map<String, Condition> keyConditions = new HashMap<>();
        Condition.Builder condition = Condition.builder().comparisonOperator(ComparisonOperator.GT.toString())
                .attributeValueList(AttributeValue.builder().n("1985").build());

        keyConditions.put("1", condition.build());

        exchange.getIn().setHeader(Ddb2Constants.KEY_CONDITIONS, keyConditions);

        command.execute();

        Map<String, AttributeValue> mapAssert = new HashMap<>();
        mapAssert.put("1", AttributeValue.builder().s("LAST_KEY").build());
        ConsumedCapacity consumed = (ConsumedCapacity) exchange.getIn().getHeader(Ddb2Constants.CONSUMED_CAPACITY);
        assertEquals(Integer.valueOf(1), exchange.getIn().getHeader(Ddb2Constants.COUNT, Integer.class));
        assertEquals(Double.valueOf(1.0), consumed.capacityUnits());
        assertEquals(mapAssert, exchange.getIn().getHeader(Ddb2Constants.LAST_EVALUATED_KEY, Map.class));
        assertEquals(keyConditions, exchange.getIn().getHeader(Ddb2Constants.KEY_CONDITIONS, Map.class));

        Map<?, ?> items = (Map<?, ?>) exchange.getIn().getHeader(Ddb2Constants.ITEMS, List.class).get(0);
        assertEquals(AttributeValue.builder().s("attrValue").build(), items.get("attrName"));
    }