package Ġio . github . dl le w el lyn . saf et or un . off device . builders Ċ Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġio . github . dl le w el lyn . saf et or un . features . signature verify . Signature Verification Query Ċ import Ġio . github . dl le w el lyn . saf et or un . models . builders . device Information Builder Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġjunit . framework . TestCase Ċ Ċ internal Ġclass ĠSignature Verification Off Device Builder Test Ġ: ĠTestCase () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġsignature Verification Query Ġ= Ġmock k < Signature Verification Query >() ĊĊĠĠĠ Ġoverride Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġsignature Verification Query . retrieve Signature For Application () Ġ} Ġreturns ĠSIGN ATURE _ SAMPLE ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` test Ġthat Ġsignature Ġverification Ġquery Ġwill Ġreturn Ġthe Ġexpected Ġsignature `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠGiven ĊĠĠĠĠĠĠĠ Ġval Ġsignature Verification Off Device Builder Ġ= ĠSignature Verification Off Device Builder ( signature Verification Query ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġsignature Verification Off Device Builder . build Off Device Result Builder ( device Information Builder ("")) ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠassertThat ( result . build Partial (). signature Verification . signature Verification String ). isEqualTo ( SIGNATURE _ SAMPLE ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ` test Ġthat Ġsignature Ġverification Ġquery Ġwill Ġreturn Ġthe Ġexpected Ġsignature Ġwhen Ġnull `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠGiven ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġsignature Verification Query . retrieve Signature For Application () Ġ} Ġreturns Ġnull ĊĠĠĠĠĠĠĠ Ġval Ġsignature Verification Off Device Builder Ġ= ĠSignature Verification Off Device Builder ( signature Verification Query ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġsignature Verification Off Device Builder . build Off Device Result Builder ( device Information Builder ("")) ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠassertThat ( result . build Partial (). signature Verification . signature Verification String ). isNull () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠSIGN ATURE _ SAMPLE Ġ= Ġ" signature Ġsample " ĊĠĠĠ Ġ} Ċ } Ċ