package Ġcom . lik et hes al ad . android . a aper . api . base Ċ Ċ import Ġcom . google . common . truth . Truth Ċ import Ġcom . lik et hes al ad . android . a aper . internal . utils . test utils . Base Mock able Ċ import Ġio . mock k . impl . annotations . Mock K Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠC Ã©s ar ĠMu Ã± oz Ġon Ġ 1 0 / 0 8 / 2 0 . Ċ Ġ*/ Ċ class ĠRequest Strategy Provider Test Ġ: ĠBase Mock able () Ġ{ ĊĊĠĠĠ Ġ@ Mock K ĊĠĠĠ Ġlateinit Ġvar Ġstrategy : ĠRequest Strategy < Any > ĊĊĠĠĠ Ġ@ Mock K ĊĠĠĠ Ġlateinit Ġvar Ġhost : ĠAny ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġrequest Strategy Provider : ĠTest Request Strategy Provider ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġrequest Strategy Provider Ġ= ĠTest Request Strategy Provider ( strategy ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Get Ġstrategy Ġby Ġname Ġwhen Ġnot Ġdefault Ġis Ġprovided `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġname Ġ= Ġ" some Name " ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġrequest Strategy Provider . get Strategy ( host , Ġname ) ĊĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( result ). isEqualTo ( strategy ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( request Strategy Provider . default Host ). isNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( request Strategy Provider . forName Host ). isEqualTo ( host ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( request Strategy Provider . forName Name ). isEqualTo ( name ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Get Ġdefault Ġstrategy Ġwhen Ġdefault Ġname Ġis Ġprovided `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġname Ġ= Ġ"[ default . strategy ]" ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġrequest Strategy Provider . get Strategy ( host , Ġname ) ĊĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( result ). isEqualTo ( strategy ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( request Strategy Provider . forName Host ). isNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( request Strategy Provider . forName Name ). isNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( request Strategy Provider . default Host ). isEqualTo ( host ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠTest Request Strategy Provider ( private Ġval Ġstrategy : ĠRequest Strategy < Any >) Ġ: ĊĠĠĠĠĠĠĠ ĠRequest Strategy Provider () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġvar Ġfor Name Host : ĠAny ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġvar Ġfor Name Name : ĠString ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġvar Ġdefault Host : ĠAny ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġget Strategy For Name ( host : ĠAny , Ġname : ĠString ): ĠRequest Strategy < out ĠAny > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfor Name Host Ġ= Ġhost ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfor Name Name Ġ= Ġname ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġstrategy ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġoverride Ġfun ĠgetDefault Strategy ( host : ĠAny ): ĠRequest Strategy < out ĠAny > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġdefault Host Ġ= Ġhost ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġstrategy ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }