package Ġnet . cord a . node . cord app Ċ Ċ import Ġnet . cord a . core . flows . Flow Logic Ċ import Ġnet . cord a . core . flows . Initi ated By Ċ import Ġnet . cord a . core . flows . Initi ating Flow Ċ import Ġnet . cord a . node . internal . cord app . C ord app Loader Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . Test Ċ import Ġjava . nio . file . Paths Ċ Ċ @ Initi ating Flow Ċ class ĠDummy Flow Ġ: ĠFlow Logic < Unit >() Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġcall () Ġ{ Ġ} Ċ } Ċ Ċ @ Initi ated By ( Dummy Flow :: class ) Ċ class ĠLoader Test Flow Ġ: ĠFlow Logic < Unit >() Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġcall () Ġ{ Ġ} Ċ } Ċ Ċ class ĠC ord app Loader Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` test Ġthat Ġclasses Ġthat Ġaren 't Ġin Ġc ord apps Ġaren 't Ġloaded `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠBase dir Ġwill Ġnot Ġbe Ġa Ġc ord a Ġnode Ġdirectory Ġso Ġthe Ġdummy Ġflow Ġshouldn 't Ġbe Ġrecogn ised Ġas Ġa Ġpart Ġof Ġa Ġc ord app ĊĠĠĠĠĠĠĠ Ġval Ġloader Ġ= ĠC ord app Loader . create Default ( Paths . get (". ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( loader . cord apps ). isEmpty () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` test Ġthat Ġclasses Ġthat Ġare Ġin Ġa Ġc ord app Ġare Ġloaded `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġloader Ġ= ĠC ord app Loader . create With Test Packages ( listOf (" net . cord a . node . cord app ")) ĊĠĠĠĠĠĠĠ Ġval Ġinitiated Flows Ġ= Ġloader . cord apps . first (). initi ated Flows ĊĠĠĠĠĠĠĠ Ġval Ġexpected Class Ġ= Ġloader . app ClassLoader . load Class (" net . cord a . node . cord app . Loader Test Flow "). as Subclass ( Flow Logic :: class . java ) ĊĠĠĠĠĠĠĠ ĠassertThat ( initi ated Flows ). contains ( expected Class ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` is olated ĠJ AR Ġcontains Ġa ĠCor D app Ġwith Ġa Ġcontract Ġand Ġplugin `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġisolated JAR Ġ= ĠC ord app Loader Test :: class . java . getResource (" is olated . jar ") !! ĊĠĠĠĠĠĠĠ Ġval Ġloader Ġ= ĠC ord app Loader . create Dev Mode ( listOf ( is olated JAR )) ĊĊĠĠĠĠĠĠĠ Ġval Ġactual Ġ= Ġloader . cord apps . to Typed Array () ĊĠĠĠĠĠĠĠ ĠassertThat ( actual ). has Size ( 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġactual C ord app Ġ= Ġactual . first () ĊĠĠĠĠĠĠĠ ĠassertThat ( actual C ord app . contract ClassNames ). isEqualTo ( listOf (" net . cord a . finance . contracts . is olated . Another Dummy Contract ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( actual C ord app . initi ated Flows ). isEmpty () ĊĠĠĠĠĠĠĠ ĠassertThat ( actual C ord app . rpc Flows ). contains ( loader . app ClassLoader . load Class (" net . cord a . core . flows . Contract Upgrade Flow \$ Init iate "). as Subclass ( Flow Logic :: class . java )) ĊĠĠĠĠĠĠĠ ĠassertThat ( actual C ord app . services ). isEmpty () ĊĠĠĠĠĠĠĠ ĠassertThat ( actual C ord app . plugins ). has Size ( 1 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( actual C ord app . plugins . first (). java Class . name ). isEqualTo (" net . cord a . finance . contracts . is olated . Is olated Plugin ") ĊĠĠĠĠĠĠĠ ĠassertThat ( actual C ord app . jar Path ). isEqualTo ( is olated JAR ) ĊĠĠĠ Ġ} Ċ } Ċ