package Ġuk . n hs . n hs x . covid 1 9 . android . app . common Ċ Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Ċ import Ġio . mock k . verify Ċ import Ġorg . junit . Test Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . share keys . Can Share Keys Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . share keys . Can Share Keys . Can Share Keys Result . Key Sharing Possible Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . share keys . Can Share Keys . Can Share Keys Result . No Key Sharing Possible Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . share keys . Key Sharing Info Provider Ċ Ċ class ĠClear Out dated Key Sharing Info Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġkey Sharing Info Provider Ġ= Ġmock k < Key Sharing Info Provider >( relax Unit Fun Ġ= Ġtrue ) ĊĠĠĠ Ġprivate Ġval Ġcan Share Keys Ġ= Ġmock k < Can Share Keys >() ĊĊĠĠĠ Ġprivate Ġval Ġtest Subject Ġ= ĠClear Out dated Key Sharing Info ( key Sharing Info Provider , Ġcan Share Keys ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` when Ġkeys Ġcan Ġbe Ġshared Ġthen Ġdo Ġnot Ġreset Ġkey Sharing Info Provider `() Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġcan Share Keys () Ġ} Ġreturns ĠKey Sharing Possible ( mock k ()) ĊĊĠĠĠĠĠĠĠ Ġtest Subject . invoke () ĊĊĠĠĠĠĠĠĠ Ġverify ( exact ly Ġ= Ġ 0 ) Ġ{ Ġkey Sharing Info Provider . reset () Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` when Ġkeys Ġcan Ġnot Ġbe Ġshared Ġthen Ġreset Ġkey Sharing Info Provider `() Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ Ġcan Share Keys () Ġ} Ġreturns ĠNo Key Sharing Possible ĊĊĠĠĠĠĠĠĠ Ġtest Subject . invoke () ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ Ġkey Sharing Info Provider . reset () Ġ} ĊĠĠĠ Ġ} Ċ } Ċ