I have to write unit test case using mockito for the below code
QuerySpec querySpec = new QuerySpec()
.withKeyConditionExpression(EXPRESSION)
.withValueMap(
new ValueMap()
.withString(ID_PLACEHOLDER, workItemId));
ItemCollection<QueryOutcome> items = index.query(querySpec);
List<Record> recordsList = new ArrayList<>();
for(Item item: items) {
recordsList.add(gson.fromJson(item.toJSON(), Record.class));
}
return recordList;
I can see similar answer using easy mock How to mock DynamoDB's ItemCollection<QueryResult> using EasyMock?. How to do write unit test case for the function above using mockito?