jeudi 30 juin 2016

How to mock DynamoDB batch save?

I wrote the dynamoDB code which stores list of items.

mapper.batchSave(trafficSensorReadings)

This will return.

List<FailedBatch>

I want to mock the mapper.batchSave and then return one failed job. How can I achieve it? I am using mockito and Junit.

I wrote something like this. But not useful.

        when(dynamoDBMapper.batchSave(eq(List.class))).thenReturn(mock(List.class));

Aucun commentaire:

Enregistrer un commentaire