package Ġcom . persistent . did . w itness . flows Ċ Ċ import Ġnet . cord a . core . flows . Flow Exception Ċ import Ġnet . cord a . core . utilities . get OrThrow Ċ import Ġorg . junit . Test Ċ import Ġkotlin . test . assertEquals Ċ import Ġkotlin . test . assert Fails With Ċ Ċ /** Ċ Ġ* ĠTest Ġcases Ġfor Ġ[ Fetch Did Document Flow ] Ċ Ġ* Ċ Ġ* ĠNodes Ġcan Ġfetch Ġdid Ġfrom Ġtheir Ġlocal Ġvault Ġby Ġinvoking Ġ[ Fetch Did Document Flow ] Ġas Ġa Ġsub - flow . Ċ Ġ*/ Ċ class ĠFetch Did Document Flow Tests Ġ: ĠAbstract Flow TestUtils () Ġ{ ĊĊ ĉ @ Test Ċ ĉ fun Ġ` fetch Ġdid Ġdocument Ġfrom Ġlocal Ġvault Ġsuccessfully `() Ġ{ Ċĉ ĉ // Ġcreate Ġa Ġdid Ġon Ġledger Ċĉ ĉ create DID ( get Did State For Create Operation (). envelope ) Ċĉ ĉ mock Network . wait Qu ies cent () Ċĉ ĉ // Ġquery Ġfor Ġdid Ċĉ ĉ val Ġflow Ġ= ĠTest Init iator ( UUID ) Ċĉ ĉ val Ġfuture Ġ= Ġorigin ator . start Flow ( flow ) Ċĉ ĉ assertEquals ( future . get OrThrow (). did Document , Ġoriginal Document ) Ċ ĉ } ĊĊ ĉ @ Test Ċ ĉ fun Ġ` fetch Ġdid Ġdocument Ġfails Ġfor Ġinvalid Ġdid `() Ġ{ Ċĉ ĉ // Ġcreate Ġa Ġdid Ġon Ġledger Ċĉ ĉ create DID ( get Did State For Create Operation (). envelope ) Ċĉ ĉ mock Network . wait Qu ies cent () Ċĉ ĉ // Ġquery Ġfor Ġdid Ċĉ ĉ val Ġflow Ġ= ĠTest Init iator ( java . util . UUID . randomUUID ()) Ċĉ ĉ val Ġfuture Ġ= Ġorigin ator . start Flow ( flow ) Ċĉ ĉ assert Fails With < Flow Exception > Ġ{ Ġfuture . get OrThrow () Ġ} Ċ ĉ } Ċ }