본문 바로가기

Android

okhttp client mock

https://github.com/gmazzo/okhttp-client-mock

androidTest 에서 network 없이 더미 코드로만으로 테스트를 할 수 없을까? 하는 생각에 잠깐 찾아보니 역시나 있다.

샘플은 https://github.com/gmazzo/okhttp-client-mock/blob/master/library/src/test/java/okhttp3/mock/MockInterceptorKotlinITTest.kt 를 참조하면 되고
쉽고 간단하게 할 수 있다.

'Android' 카테고리의 다른 글

android q 에서 sandbox 경로  (0) 2019.05.15
android q 로 타겟팅 하기  (0) 2019.05.15
viewstub 또는 include 에서의 data binding  (0) 2019.04.30
LazyThreadSafetyMode.NONE lazy  (0) 2019.04.29
android q  (0) 2019.04.08