import Ġcom . ap ol log raph ql . apollo 3 . A pol lo Client Ċ import Ġcom . ap ol log raph ql . apollo 3 . android . A pol lo Id ling Resource Ċ import Ġcom . ap ol log raph ql . apollo 3 . android . id ling Resource Ċ import Ġcom . ap ol log raph ql . apollo 3 . mock server . Mock Response Ċ import Ġcom . ap ol log raph ql . apollo 3 . mock server . Mock Server Ċ import Ġid ling . resource . Id ling Resource Query Ċ import Ġkotlinx . coroutines . Coroutine Start Ċ import Ġkotlinx . coroutines . delay Ċ import Ġkotlinx . coroutines . launch Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . junit . Test Ċ Ċ class ĠId ling Resource Test Ġ{ ĊĠ Ġ@ Test ĊĠ Ġfun Ġid ling Resource Single Query () Ġ= Ġrun Blocking Ġ{ ĊĠĠĠ Ġval Ġmock Server Ġ= ĠMock Server () ĊĠĠĠ Ġmock Server . enqueue ( ĊĠĠĠĠĠĠĠ ĠMock Response ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstatusCode Ġ= Ġ 5 0 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdelay Millis Ġ= Ġ 5 0 0 , ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġval Ġid ling Resource Ġ= ĠApollo Id ling Resource (" test ") ĊĠĠĠ Ġval Ġap ollo Client Ġ= ĠApollo Client . Builder () ĊĠĠĠĠĠĠĠ Ġ. server Url ( mock Server . url ()) ĊĠĠĠĠĠĠĠ Ġ. id ling Resource ( id ling Resource ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġlaunch ( start Ġ= ĠCor outine Start . UN DISPATCH ED ) Ġ{ ĊĠĠĠĠĠ Ġkotlin . run Catch ing Ġ{ ĊĠĠĠĠĠĠĠ Ġap ollo Client . query ( Id ling Resource Query ()). execute () ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġassert (! id ling Resource . is Idle Now ) ĊĠĠĠ Ġdelay ( 3 0 0 ) ĊĠĠĠ Ġassert (! id ling Resource . is Idle Now ) ĊĠĠĠ Ġdelay ( 5 0 0 ) ĊĠĠĠ Ġassert ( id ling Resource . is Idle Now ) ĊĠ Ġ} Ċ }