* @throws DefinitionNotFoundException
* @throws Exception
*/
public MockAction mockServerAction(DefDescriptor<ControllerDef> controllerDefDescriptor, String actionName,
Object returnValue) throws Exception {
final ControllerDef originalControllerDef = Aura.getDefinitionService().getDefinition(controllerDefDescriptor);
final ControllerDef controllerDef = Mockito.spy(originalControllerDef);
final MockAction mockAction = Mockito.spy(new MockAction(originalControllerDef.getSubDefinition(actionName)
.getDescriptor(), State.SUCCESS, returnValue));
Mockito.doReturn(mockAction).when(controllerDef)
.createAction(Mockito.eq(actionName), Mockito.anyMapOf(String.class, Object.class));
mockDef(controllerDef);