package Ġcom . rar ible . ethereum . contract . service Ċ Ċ import Ġcom . rar ible . contracts . test . erc 1 1 5 5 . Test ERC 1 1 5 5 Ċ import Ġcom . rar ible . contracts . test . erc 2 0 . Test ERC 2 0 Ċ import Ġcom . rar ible . contracts . test . erc 7 2 1 . Test ERC 7 2 1 Ċ import Ġcom . rar ible . core . test . containers . Mong odb Reactive Base Test Ċ import Ġcom . rar ible . core . test . containers . Open E thereum Test Container Ċ import Ġcom . rar ible . core . contract . model . Contract Type Ċ import Ġcom . rar ible . ethereum . contract . repository . Contract Repository Ċ import Ġkotlinx . coroutines . reactive . await First Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . test containers . junit . jupiter . Test containers Ċ Ċ @ Test containers Ċ class ĠContract Service Test Ġ: ĠMong odb Reactive Base Test () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġe thereum Test Container Ġ= ĠOpen E thereum Test Container () ĊĠĠĠ Ġprivate Ġval Ġrepository Ġ= ĠContract Repository ( create Reactive Mongo Template ()) ĊĠĠĠ Ġprivate Ġval Ġcontract Service Ġ= ĠContract Service ( repository , Ġe thereum Test Container . readOnly Transaction Sender ()) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` fetch Ġand Ġsave Ġer c 7 2 1 Ġcontract `() Ġ= Ġrun Blocking < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuser Sender Ġ= Ġe thereum Test Container . signing Transaction Sender () ĊĠĠĠĠĠĠĠ Ġval Ġpol ler Ġ= Ġe thereum Test Container . mono Transaction Poller () ĊĊĠĠĠĠĠĠĠ Ġval Ġname Ġ= Ġ" Test ĠERC 7 2 1 " ĊĠĠĠĠĠĠĠ Ġval Ġsymbol Ġ= Ġ" ERC 7 2 1 ĠSymbol " ĊĠĠĠĠĠĠĠ Ġval Ġcontract Ġ= ĠTest ERC 7 2 1 . deploy And Wait ( user Sender , Ġpol ler , Ġname , Ġsymbol ). await First () ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġcontract Service . get ( contract . address ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . type ). isEqualTo ( Contract Type . ERC 7 2 1 _ TOKEN ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . name ). isEqualTo ( name ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . symbol ). isEqualTo ( symbol ) ĊĊĠĠĠĠĠĠĠ Ġval Ġsaved Contract Ġ= Ġrepository . findById ( contract . address ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( saved Contract ). isEqualTo ( result ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` fetch Ġand Ġsave Ġer c 1 1 5 5 Ġcontract `() Ġ= Ġrun Blocking < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuser Sender Ġ= Ġe thereum Test Container . signing Transaction Sender () ĊĠĠĠĠĠĠĠ Ġval Ġpol ler Ġ= Ġe thereum Test Container . mono Transaction Poller () ĊĊĠĠĠĠĠĠĠ Ġval Ġname Ġ= Ġ" Test ĠERC 1 1 5 5 " ĊĠĠĠĠĠĠĠ Ġval Ġsymbol Ġ= Ġ" ERC 1 1 5 5 ĠSymbol " ĊĠĠĠĠĠĠĠ Ġval Ġcontract Ġ= ĠTest ERC 1 1 5 5 . deploy And Wait ( user Sender , Ġpol ler , Ġname ). await First () ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġcontract Service . get ( contract . address ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . type ). isEqualTo ( Contract Type . ERC 1 1 5 5 _ TOKEN ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . name ). isEqualTo ( null ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . symbol ). isEqualTo ( null ) ĊĊĠĠĠĠĠĠĠ Ġval Ġsaved Contract Ġ= Ġrepository . findById ( contract . address ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( saved Contract ). isEqualTo ( result ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` fetch Ġand Ġsave Ġer c 2 0 Ġcontract `() Ġ= Ġrun Blocking < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuser Sender Ġ= Ġe thereum Test Container . signing Transaction Sender () ĊĠĠĠĠĠĠĠ Ġval Ġpol ler Ġ= Ġe thereum Test Container . mono Transaction Poller () ĊĊĠĠĠĠĠĠĠ Ġval Ġname Ġ= Ġ" Test ĠERC 2 0 " ĊĠĠĠĠĠĠĠ Ġval Ġsymbol Ġ= Ġ" ERC 2 0 ĠSymbol " ĊĠĠĠĠĠĠĠ Ġval Ġcontract Ġ= ĠTest ERC 2 0 . deploy And Wait ( user Sender , Ġpol ler , Ġname , Ġsymbol ). await First () ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġcontract Service . get ( contract . address ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . type ). isEqualTo ( Contract Type . ERC 2 0 _ TOKEN ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . name ). isEqualTo ( name ) ĊĠĠĠĠĠĠĠ ĠassertThat ( result . symbol ). isEqualTo ( symbol ) ĊĊĠĠĠĠĠĠĠ Ġval Ġsaved Contract Ġ= Ġrepository . findById ( contract . address ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( saved Contract ). isEqualTo ( result ) ĊĠĠĠ Ġ} Ċ } ĊĊ