waitForAndCheckIviServiceCoFunResult

fun <R, F : KFunction<R>> waitForAndCheckIviServiceCoFunResult(    function: F,     timeoutMs: Long = DEFAULT_WAIT_LIVE_DATA_TIMEOUT_MS,     block: suspend (F) -> R): R

Utility function to wait for an IVI service coroutine function result and check it.

Invokes block with the function as argument and waits for it to return until timeoutMs is reached.

On a timeout or when the block throws an exception, an AssertionError is thrown. The assertion message contains the function signature.

Returns the value returned by the block.

Prefer this function over waitForAndCheckIviServiceAsyncFunResult as this function is able to add the function signature to the thrown AssertionError exceptions.

Example usage:

val tripService = createApiWrapper { TripService.createApi(...) }
waitForAndCheckIviServiceCoFunResult(TripServiceApi::coPlanTripTo) {
it(tripService, EINDHOVEN_PLACE)
}