package Ġcom . tit ou . bl a um . data _ source Ċ Ċ import Ġcom . tit ou . bl a um . data _ source . Title Api Mock . TIT LES _ API _ SERVICE _ ST UB _ GET _ TIT LES _ RESPONSE Ċ import Ġcom . tit ou . bl a um . data _ source . remote . titles _ api . api . Titles ApiService Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġio . reactivex . rx java 3 . core . Observable Ċ import Ġretrofit 2 . Response Ċ Ċ object ĠStub s Ġ{ ĊĊĠĠĠ Ġval Ġdefault Error Ġ= ĠThrowable (" Test Ġerror ") ĊĊĠĠĠ Ġfun Ġcreate Title ApiService Stub s () Ġ: ĠTitle s ApiService Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtitles ApiService Ġ= Ġmock k < Titles ApiService >() ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġtitles ApiService . getTitle s () Ġ} Ġreturns ĠObservable . just ( Response . success ( TIT LES _ API _ SERVICE _ ST UB _ GET _ TIT LES _ RESPONSE )) ĊĠĠĠĠĠĠĠ Ġreturn Ġtitles ApiService ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcreate Error Throw ing Title ApiService Stub s () Ġ: ĠTitle s ApiService Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtitles ApiService Ġ= Ġmock k < Titles ApiService >() ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġtitles ApiService . getTitle s () Ġ} Ġreturns ĠObservable . error ( default Error ) ĊĠĠĠĠĠĠĠ Ġreturn Ġtitles ApiService ĊĠĠĠ Ġ} Ċ Ċ } ĊĊĊ