package Ġme . uport . sdk . uport defaults Ċ Ċ import Ġassert k . assertThat Ċ import Ġassert k . assertions . isFalse Ċ import Ġassert k . assertions . isTrue Ċ import Ġme . uport . sdk . eth rd id . E thr DID Network Ċ import Ġme . uport . sdk . eth rd id . E thr DID Resolver Ċ import Ġme . uport . sdk . https did . Web DID Resolver Ċ import Ġme . uport . sdk . jsonrpc . Json RPC Ċ import Ġme . uport . sdk . universal did . DID Resolver Ċ import Ġorg . junit . Test Ċ Ċ class ĠD ID Resolver Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` can Ġresolve Ġvalid Ġd ids Ġafter Ġadding Ġresolver s `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresolver Ġ= ĠD ID Resolver . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Resolver ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠE thr DID Resolver . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Network ( E thr DID Network ("", Ġ" 0 x registry ", ĠJson RPC (" "))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Resolver ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠWeb DID Resolver () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ). build () ĊĊĠĠĠĠĠĠĠ Ġval Ġd ids Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 xb 9 c 5 7 1 4 0 8 9 4 7 8 a 3 2 7 f 0 9 1 9 7 9 8 7 f 1 6 f 9 e 5 d 9 3 6 e 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : https : example . com ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : https : example . ng rok . com # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : web : example . com ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : web : example . com # owner " ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġd ids . forEach Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( resolver . can Resolve ( it )). isTrue () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` fails Ġto Ġresolve Ġvalid Ġd ids Ġwithout Ġadding Ġresolver s `() Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġresolver Ġ= ĠD ID Resolver . Builder (). build () ĊĊĠĠĠĠĠĠĠ Ġval Ġd ids Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 xb 9 c 5 7 1 4 0 8 9 4 7 8 a 3 2 7 f 0 9 1 9 7 9 8 7 f 1 6 f 9 e 5 d 9 3 6 e 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : main net : 0 xb 9 c 5 7 1 4 0 8 9 4 7 8 a 3 2 7 f 0 9 1 9 7 9 8 7 f 1 6 f 9 e 5 d 9 3 6 e 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : main net : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : main net : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : rin ke by : 0 xb 9 c 5 7 1 4 0 8 9 4 7 8 a 3 2 7 f 0 9 1 9 7 9 8 7 f 1 6 f 9 e 5 d 9 3 6 e 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : rin ke by : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : rin ke by : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 x 1 : 0 xb 9 c 5 7 1 4 0 8 9 4 7 8 a 3 2 7 f 0 9 1 9 7 9 8 7 f 1 6 f 9 e 5 d 9 3 6 e 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 x 1 : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 x 1 : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 x 0 4 : 0 xb 9 c 5 7 1 4 0 8 9 4 7 8 a 3 2 7 f 0 9 1 9 7 9 8 7 f 1 6 f 9 e 5 d 9 3 6 e 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 x 0 4 : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r : 0 x 0 4 : 0 xB 9 C 5 7 1 4 0 8 9 4 7 8 a 3 2 7 F 0 9 1 9 7 9 8 7 f 1 6 f 9 E 5 d 9 3 6 E 8 a # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : https : example . com ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : https : example . ng rok . com # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : web : example . com ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : web : example . com # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 2 n Q ti Q G 6 C gm 1 GY TB aa KA gr 7 6 u Y 7 i Sex Uk q X ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 5 A 8 b RW U 3 F 7 j 3 R Ex 3 vk JW xd j QP p 4 t qm xF Pm ab 1 Tr ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : uport : 2 n Q ti Q G 6 C gm 1 GY TB aa KA gr 7 6 u Y 7 i Sex Uk q X ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : uport : 2 n Q ti Q G 6 C gm 1 GY TB aa KA gr 7 6 u Y 7 i Sex Uk q X # owner ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : generic : 0 x 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : generic : 0 1 2 3 4 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : generic : has Ġspaces ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : generic : more : col ons ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : generic : 0 1 2 3 4 # fragment - attached ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : generic : 0 1 2 3 4 ? key = value ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : generic : 0 1 2 3 4 ? key = value & other - key = other - value " ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġd ids . forEach Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( resolver . can Resolve ( it )). isFalse () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` fails Ġon Ġinvalid Ġd ids `() Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġresolver Ġ= ĠD ID Resolver . Builder (). build () ĊĊĠĠĠĠĠĠĠ Ġval Ġd ids Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ"", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" 0 x 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" eth r : 0 x 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did :: something ", ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ" did : eth r :" ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġd ids . forEach Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( resolver . can Resolve ( it )). isFalse () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } ĊĊ