package Ġcom . rar ible . ethereum . listener . log Ċ Ċ import Ġcom . rar ible . ethereum . listener . log . domain . Block Head Ċ import Ġcom . rar ible . ethereum . listener . log . persist . Block Repository Ċ import Ġio . da onom ic . rpc . domain . Word Factory Ċ 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 . springframework . beans . factory . annotation . Autowired Ċ Ċ @ IntegrationTest Ċ class ĠBlock Repository Test Ġ: ĠAbstract IntegrationTest () Ġ{ ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġblock Repository : ĠBlock Repository ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfind Blocks Works () Ġ= Ġrun Blocking < Unit > Ġ{ ĊĠĠĠĠĠĠĠ Ġmongo . save ( Block Head ( 1 0 0 , ĠWord Factory . create (), Ġ 1 )). await First () ĊĠĠĠĠĠĠĠ Ġmongo . save ( Block Head ( 1 0 1 , ĠWord Factory . create (), Ġ 1 )). await First () ĊĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Repository . find Blocks ( 1 0 0 , Ġ 1 0 1 ). collect List (). await First () ĊĠĠĠĠĠĠĠ Ġ). has Size ( 1 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Repository . find Blocks ( null , Ġnull ). collect List (). await First () ĊĠĠĠĠĠĠĠ Ġ). has Size ( 2 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Repository . find Blocks ( 1 0 1 , Ġnull ). collect List (). await First () ĊĠĠĠĠĠĠĠ Ġ). has Size ( 1 ) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Repository . find Blocks ( null , Ġ 1 0 1 ). collect List (). await First () ĊĠĠĠĠĠĠĠ Ġ). has Size ( 1 ) ĊĠĠĠ Ġ} Ċ }