Suspending function test with MockWebServer
问题 I'm testing api that returns result using suspending function with MockWebServer, but it does not work with runBlockingTest, testCoroutineDispatcher, testCorounieScope unless a launch builder is used, why? abstract class AbstractPostApiTest { internal lateinit var mockWebServer: MockWebServer private val responseAsString by lazy { getResourceAsText(RESPONSE_JSON_PATH) } @BeforeEach open fun setUp() { mockWebServer = MockWebServer() println("AbstractPostApiTest setUp() $mockWebServer") }