mockkOptionalService
Mocks the IVI service returned by createApiOrNull. This is for services that are optionally registered. For services that are always expected to be registered, use mockkService instead.
Return
A reference to the created service mock. The caller does not need to keep a reference in order to prevent the mock from being garbage collected.
Parameters
The type of the service API.
A function reference to the createApiOrNull
call used by production code to get a reference to the service API.
Whether or not the services is considered to be registered. Production code will get null
when creating a service API when false
.
If IviServiceApiBase.queueOrRunAction is called while the service is not available (IviServiceApiBase.serviceAvailable is false
), the lambda given to IviServiceApiBase.queueOrRunAction is added to this list.
The MockK block for the service mock, containing things like every statements.