hi - I am trying to use doAnswer() to stub the void method to call MyBatis mapper interface.
Mockito.doAnswer(new Answer()
{
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
Map<String, String> input = (Map<String, String>) invocation.getArguments()[0];
input.put("NEW_PARAM","VALUE");
return input;
}}).when(mockDAOLayer).getData(inputMap);
so I am trying to get the Input map that gets passed to the DAOLayer.getData() method and return the map with one additional parameter in it back to the real object.
with real objects, this map would get updated by MyBatis interface with the additional parameter after the DB Stored Procedure call.