package Ġfr . free . n rw . commons . explore . categories . media Ċ Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . never Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . verify Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . wh enever Ċ import Ġfr . free . n rw . commons . explore . paging . LiveData Converter Ċ import Ġfr . free . n rw . commons . media . Media Client Ċ import Ġio . reactivex . Single Ċ import Ġorg . hamcrest . Core Matchers .` is ` Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito Annotations Ċ Ċ class ĠPage able Categories Media DataSource Test Ġ{ ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġmedia Client : ĠMedia Client ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġlive Data Converter : ĠLive Data Converter ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` load Function Ġcalls Ġreset Ġat Ġposition Ġ 0 `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠdataSource Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPage able Categories Media DataSource ( live Data Converter , Ġmedia Client ) ĊĠĠĠĠĠĠĠ ĠdataSource . on Query Updated (" test ") ĊĠĠĠĠĠĠĠ Ġwhenever ( media Client . get Media List From Category (" test ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( Single . just ( emptyList ())) ĊĠĠĠĠĠĠĠ ĠassertThat ( dataSource . load Function (- 1 , Ġ 0 ), Ġ` is `( emptyList ())) ĊĠĠĠĠĠĠĠ Ġverify ( media Client ). reset Category Continuation (" test ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` load Function Ġdoes Ġnot Ġcall Ġreset Ġat Ġany Ġother Ġposition `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠdataSource Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPage able Categories Media DataSource ( live Data Converter , Ġmedia Client ) ĊĠĠĠĠĠĠĠ ĠdataSource . on Query Updated (" test ") ĊĠĠĠĠĠĠĠ Ġwhenever ( media Client . get Media List From Category (" test ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( Single . just ( emptyList ())) ĊĠĠĠĠĠĠĠ ĠassertThat ( dataSource . load Function (- 1 , Ġ 1 ), Ġ` is `( emptyList ())) ĊĠĠĠĠĠĠĠ Ġverify ( media Client , Ġnever ()). reset Category Continuation (" test ") ĊĠĠĠ Ġ} Ċ } Ċ