I am facing issue regarding mockito test case for coroutines. It is not executing api call function. Please have a look below code. It is MVP based structure
//MVP Structure
GlobalScope.launch {
// API CALL ON MAIN THREAD
val result = //Model return some values
GlobalScope.launch(Dispatchers.Main) {
when (result) {
is APIResult.Success ->(result.response.data)
is APIResult.Failure -> parseException(result.details)
}
}
}
}
Any suggestion?