package Ġcom . kk box . open ap ide veloper test . api Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . support . test . Instrumentation Registry Ċ import Ġandroid . support . test . runner . Android JUnit 4 Ċ import Ġcom . kk box . open ap ide veloper . api . Genre Station Fetcher Ċ import Ġcom . kk box . open ap ide veloper . api . HttpClient Ċ import Ġcom . kk box . open ap ide veloper . auth . Auth Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġjava . util . concurrent . TimeUnit Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠGen re Station Fetcher Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġcontext : ĠContext Ġ= ĠInstrument ation Registry . getTarget Context () ĊĠĠĠ Ġprivate Ġval Ġauth : ĠAuth Ġ= ĠAuth ( com . kk box . open ap ide veloper . Client Info . CLIENT _ ID , Ġcom . kk box . open ap ide veloper . Client Info . CLIENT _ SECRET , Ġcontext ) ĊĠĠĠ Ġprivate Ġval ĠaccessToken : ĠString Ġ= Ġauth . client Credentials Flow . fetch AccessToken (). get (). get (" access _ token "). asString ĊĠĠĠ Ġprivate Ġval ĠhttpClient : ĠHttpClient Ġ= ĠHttpClient ( accessToken , Ġcontext ) ĊĠĠĠ Ġprivate Ġval Ġgenre Station Fetcher : ĠGen re Station Fetcher Ġ= ĠGen re Station Fetcher ( httpClient ). set Genre Station Id (" TY q 3 EH FT l - 1 EO v JM 5 Y ") ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfetch All Genre St ations () Ġ{ ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( genre Station Fetcher . fetch All Genre St ations (). get ( 1 0 , ĠTimeUnit . SECONDS ). has (" data ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfetch Metadata () Ġ{ ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( genre Station Fetcher . fetch Metadata (). get ( 1 0 , ĠTimeUnit . SECONDS ). has (" id ")) ĊĠĠĠ Ġ} Ċ }