doAnswer(new Answer<Void>() {
@Override
public Void answer(InvocationOnMock invocation) throws Throwable {
Object[] arguments = invocation.getArguments();
GetTransUnitList action = (GetTransUnitList) arguments[0];
action.setWorkspaceId(WORKSPACE_ID);
GetTransUnitListHandler handler =
new MockHandlerFactory()
.createGetTransUnitListHandlerWithBehavior(
DOCUMENT.getId(), TEXT_FLOWS, LOCALE,
action.getOffset(), action.getCount());
getTransUnitListResult = handler.execute(action, null);
return null;
}
}).when(dispatcher).execute(actionCaptor.capture(),
asyncCallbackCaptor.capture());