mboudreau / Alternator

A mock DynamoDB that runs locally for testing purposes - DEPRECATED, PLEASE USE DYNAMODB LOCAL: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
Apache License 2.0
78 stars 39 forks source link

Need to fix scan function, some tests are failing #24

Closed mboudreau closed 12 years ago

mboudreau commented 12 years ago

The scan is failing on queryWithHashKey(com.michelboudreau.test.AlternatorQueryTest)

sceutre commented 12 years ago

In AlternatorDBHandler scan() there is the code:

    for (Map<String, AttributeValue> item : items) {
        result.setLastEvaluatedKey(new Key(item.get("id")));
    }

Which is wrong I believe and should look more like:

    for (Map<String, AttributeValue> item : items) {
        result.setLastEvaluatedKey(new Key(item.get(theTable.getHashKeyName())));
    }
mboudreau commented 12 years ago

I do believe you are correct sir, let me change that :)

mboudreau commented 12 years ago

I've fixed the problem, but the test is still not running properly. I'm going to spend some time on fixing this.