Skip to main content
[ This file is autogenerated from apexdoc ]

AqApexMocks

ISTEST

Implemented types

System.StubProvider

Group modules/enterprise

Constructors​

public AqApexMocks()​


Methods​

public Object mock(Type classToMock)​

Creates mock object of given class or interface.

Parameters​

ParamDescription
classToMockclass or interface to mock.

Returns​

TypeDescription
Objectmock object.

public Object handleMethodCall(Object stubbedObject, String stubbedMethodName, Type returnType, List<Type> listOfParamTypes, List<String> listOfParamNames, List<Object> listOfArgs)​

Inherited from StubProvider.

Parameters​

ParamDescription
stubbedObjectThe stubbed object.
stubbedMethodNameThe name of the invoked method.
returnTypeThe return type of the invoked method.
listOfParamTypesA list of the parameter types of the invoked method.
listOfParamNamesA list of the parameter names of the invoked method.
listOfArgsThe actual argument values passed into this method at runtime.

Returns​

TypeDescription
ObjectThe stubbed return value. Null by default, unless you prepared one that matches this method and argument values in stubbing.

public void startStubbing()​

Tell ApexMocks framework you are about to start stubbing using when() calls.

public void stopStubbing()​

Tell ApexMocks framework you are about to stop stubbing using when() calls.

public AqMethodReturnValue when(Object ignoredRetValue)​

SUPPRESSWARNINGS

Method to start recording method usage inside stubbing context

Parameters​

ParamDescription
ignoredRetValueignored returned value of called mocked instance method, invocation will be stubbed

Returns​

TypeDescription
AqMethodReturnValueThe mock object instance.

public Object verify(Object mockInstance)​

Verify a method was called on a mock object.

Parameters​

ParamDescription
mockInstanceThe mock object instance.

Returns​

TypeDescription
ObjectThe mock object instance.

public Object verify(Object mockInstance, Integer times)​

Verify a method was called on a mock object.

Parameters​

ParamDescription
mockInstanceThe mock object instance.
timesHow many times it was called

Returns​

TypeDescription
ObjectThe mock object instance.

Classes​

AqApexMocksException​

Inheritance

AqApexMocksException