Created
June 15, 2023 22:29
-
-
Save tugceaktepe/4aad945b3c17e5e02aaf211242a6f7ba to your computer and use it in GitHub Desktop.
OkHttp3IdlingResource usage in a UI test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Inject | |
lateinit var okHttp: OkHttpClient | |
private lateinit var okHttp3IdlingResource: OkHttp3IdlingResource | |
@Before | |
fun setup() { | |
hiltRule.inject() | |
okHttp3IdlingResource = OkHttp3IdlingResource.create("okhttp", okHttp) | |
IdlingRegistry.getInstance().register(okHttp3IdlingResource) | |
mockWebServer.start(8080) | |
} | |
@After | |
fun teardown() { | |
mockWebServer.shutdown() | |
IdlingRegistry.getInstance().unregister(okHttp3IdlingResource) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment