Closed ingojaeckel closed 12 years ago
Awesome, I'll look into it, thanks for this. Right now, our scan and query approaches don't work as we're refactoring it. We're hoping to get it done today.
Cheers.
Thanks @jaeckel for the code. If you have time to create tests around this, it would be appreciated.
In this basic implementation I use FakeFuture instances to wrap results of synchronous AmazonDynamoDBClient calls. This would already allow clients to mock (synchronous and) asynchronous DynamoDB calls with Alternator.
However, I could not verify the change this many of the test cases currently fail. This is what I get when I run mvn clean install after a fresh git clone:
Failed tests: queryWithHashKeyTest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndAttributesToGetTest(com.michelboudreau.test.AlternatorQueryTest) putItemInTableTest(com.michelboudreau.test.AlternatorItemTest): expected: but was:<{testfield={S: test, }, id={S: 123, }, date={N: 56789, }}>
updateItemInTableTest(com.michelboudreau.test.AlternatorItemTest): expected: but was:<{testfield={S: test, }, id={S: 123, }, date={N: 56789, }}>
Tests in error: queryWithHashKeyAndRangeKeyConditionEQTest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndRangeKeyConditionGETest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndRangeKeyConditionGTTest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndRangeKeyConditionLETest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndRangeKeyConditionLTTest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndRangeKeyConditionINTest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndRangeKeyConditionBETWEENTest(com.michelboudreau.test.AlternatorQueryTest) queryWithHashKeyAndLimitTest(com.michelboudreau.test.AlternatorQueryTest) basicScanTest(com.michelboudreau.test.AlternatorScanTest) scanWithLimitTest(com.michelboudreau.test.AlternatorScanTest) scanWithAttributesToGetTest(com.michelboudreau.test.AlternatorScanTest) scanWithScanFilterEQTest(com.michelboudreau.test.AlternatorScanTest) scanWithScanFilterGETest(com.michelboudreau.test.AlternatorScanTest) scanWithScanFilterGTTest(com.michelboudreau.test.AlternatorScanTest) scanWithScanFilterLETest(com.michelboudreau.test.AlternatorScanTest) scanWithScanFilterLTTest(com.michelboudreau.test.AlternatorScanTest) scanWithScanFilterINTest(com.michelboudreau.test.AlternatorScanTest) scanWithScanFilterBETWEENTest(com.michelboudreau.test.AlternatorScanTest) scanPaginationTest(com.michelboudreau.test.AlternatorScanTest) batchGetItemInTableWithoutNameTest(com.michelboudreau.test.AlternatorItemTest): Unable to marshall request to JSON: Null key.
Thanks, Ingo