/* Ċ Ġ* ĠThis Ġis Ġfree Ġand Ġun enc umber ed Ġsoftware Ġreleased Ġinto Ġthe Ġpublic Ġdomain , Ġfollowing Ġ< https :// un license . org > Ċ Ġ*/ Ċ Ċ package Ġorg . u fo ss . kot ys a . spring . jdbc . m ariadb Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Before All Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . jdbc . core . Jdbc Operations Ċ import Ġorg . u fo ss . kot ys a . test .* Ċ import Ġorg . u fo ss . kot ys a . test . hooks . Test Containers Closeable Resource Ċ Ċ class ĠSpring Jdbc Select OrderBy M ariadb Test Ġ: ĠAbstract Spring Jdbc M ariadb Test < OrderBy Repository M ariadb Select >() Ġ{ ĊĊĠĠĠ Ġ@ Before All ĊĠĠĠ Ġfun Ġbefore All ( resource : ĠTest Containers Closeable Resource ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcontext Ġ= Ġstart Context < OrderBy Repository M ariadb Select >( resource ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġval Ġrepository : ĠOrder By Repository M ariadb Select Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠgetContext Repository () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Verify Ġselect Customer OrderBy Age Asc Ġreturns Ġall Ġcustomers Ġordered Ġby Ġage ĠASC `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( repository . select Customer OrderBy Age Asc ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Size ( 3 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. contains Exactly ( customer Fr ance , Ġcustomer USA 2 , Ġcustomer USA 1 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Verify Ġselect Customer OrderBy Age And Id Asc Ġreturns Ġall Ġcustomers Ġordered Ġby Ġage Ġand Ġid ĠASC `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( repository . select Customer OrderBy Age And Id Asc ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Size ( 3 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. contains Exactly ( customer Fr ance , Ġcustomer USA 2 , Ġcustomer USA 1 ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠOrder By Repository M ariadb Select ( client : ĠJdbc Operations ) Ġ: ĠAbstract Customer Repository Spring Jdbc M ariadb ( client ) Ġ{ ĊĊĠĠĠ Ġfun Ġselect Customer OrderBy Age Asc () Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ( sql Client Ġselect From ĠM ARI AD B _ CUSTOMER ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠorderBy Asc ĠM ARI AD B _ CUSTOMER . age ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ). fetch All () ĊĊĠĠĠ Ġfun Ġselect Customer OrderBy Age And Id Asc () Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ( sql Client Ġselect From ĠM ARI AD B _ CUSTOMER ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠorderBy Asc ĠM ARI AD B _ CUSTOMER . age Ġand Asc ĠM ARI AD B _ CUSTOMER . id ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ). fetch All () Ċ } Ċ