package Ġcom . rent Ċ Ċ import Ġcom . rent . flows . Rent A gr Create Flow Ċ import Ġcom . rent . flows . Responder Ċ import Ġcom . rent . states . Rent A gr State Ċ import Ġnet . cord a . core . identity . Party Ċ import Ġnet . cord a . core . node . services . vault . Query Criteria Ċ import Ġnet . cord a . core . transactions . Signed Transaction Ċ import Ġnet . cord a . core . utilities . get OrThrow Ċ import Ġnet . cord a . testing . internal . choose Identity And Cert Ċ import Ġnet . cord a . testing . node . Mock Network Ċ import Ġnet . cord a . testing . node . Mock Network Parameters Ċ import Ġnet . cord a . testing . node . Test C ord app Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġkotlin . test . assertEquals Ċ Ċ class ĠFlow Tests Ġ{ ĊĠĠĠ Ġprivate Ġval Ġnetwork Ġ= ĠMock Network ( Mock Network Parameters ( cord apps ForAll Nodes Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTest C ord app . find C ord app (" com . template . contracts "), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTest C ord app . find C ord app (" com . template . flows ") ĊĠĠĠ Ġ))) ĊĠĠĠ Ġprivate Ġval Ġowner Node Ġ= Ġnetwork . createNode () ĊĠĠĠ Ġprivate Ġval Ġparty 1 Node Ġ= Ġnetwork . createNode () ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠlistOf ( owner Node , Ġparty 1 Node ). forEach Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . register Initi ated Flow ( Responder :: class . java ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ= Ġnetwork . run Network () ĊĊĠĠĠ Ġ@ After ĊĠĠĠ Ġfun ĠtearDown () Ġ= Ġnetwork . stop Nodes () ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` dummy Ġtest `() Ġ{ ĊĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` create Ġflow Ġtest `() Ġ{ ĊĊĠĠĠĠĠĠĠ Ġprintln (" Executing ĠV accine Ġcreate Ġflow ") ĊĊĠĠĠĠĠĠĠ Ġ// id ens ĊĠĠĠĠĠĠĠ Ġval Ġowner = owner Node . info . choose Identity And Cert (). party ĊĠĠĠĠĠĠĠ Ġval Ġparty 1 = party 1 Node . info . choose Identity And Cert (). party ĊĊĠĠĠĠĠĠĠ Ġval Ġmembers : Mutable List < Party > Ġ= Ġmutable ListOf ( party 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġv accine State = Rent A gr State ( id Ġ= Ġ" 1 2 3 ", Ġowner Ġ= Ġowner , Ġmembers Ġ= Ġmembers , agreement Expiry Date Ġ= Ġ" 2 2 nd Ġoct ", legal Doc Link Ġ= Ġ" some URL ") ĊĠĠĠĠĠĠĠ Ġval Ġcreate Flow = Rent A gr Create Flow ( v accine State ) ĊĠĠĠĠĠĠĠ Ġval Ġfuture = Ġowner Node . start Flow ( create Flow ) ĊĊĠĠĠĠĠĠĠ Ġnetwork . run Network () ĊĊĠĠĠĠĠĠĠ Ġval Ġf tx : ĠSigned Transaction Ġ= Ġfuture . get OrThrow () ĊĠĠĠĠĠĠĠ Ġf tx . verify Required Signatures () ĊĠĠĠĠĠĠĠ Ġval Ġquery Criteria Ġ= ĠQuery Criteria . Linear State Query Criteria ( external Id Ġ= ĠlistOf ( v accine State . id )) ĊĠĠĠĠĠĠĠ Ġval Ġqueried State = party 1 Node . services . vault Service . query By ( Rent A gr State :: class . java , query Criteria ). states . first (). state . data ĊĠĠĠĠĠĠĠ Ġprintln (" Qu er ied ĠState Ġis Ġ"+ quer ied State . toString ()) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( v accine State , quer ied State ) ĊĊĊĠĠĠ Ġ} ĊĊ Ċ }