import Ġorg . gradle . api . tasks . testing . logging . Test Log Event Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġkotlin (" jvm ") Ġversion Ġ" 1 . 5 . 0 " ĊĠĠĠ Ġid (" com . av ast . gradle . docker - compose ") Ġversion Ġ" 0 . 1 4 . 9 " Ċ } Ċ Ċ repositories Ġ{ Ġmaven Central () Ġ} Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġimplementation ( platform (" org . jetbrains . kotlin : kotlin - bom ")) ĊĠĠĠ Ġimplementation (" org . jetbrains . kotlin : kotlin - stdlib - jdk 8 ") ĊĊĠĠĠ Ġtest Implementation (" org . junit . jupiter : junit - jupiter : 5 . 7 . 2 ") ĊĊĠĠĠ Ġtest Implementation (" io . rest - ass ured : rest - ass ured : 4 . 4 . 0 ") ĊĠĠĠ Ġtest Implementation (" io . rest - ass ured : kotlin - extensions : 4 . 4 . 0 ") ĊĠĠĠ Ġtest Runtime Only (" com . google . code . gson : gson : 2 . 8 . 8 ") ĊĊĠĠĠ Ġtest Runtime Only ( project (": db ")) ĊĠĠĠ Ġtest Runtime Only (" org . postgresql : postgresql : 4 2 . 2 . 2 3 ") ĊĠĠĠ Ġtest Implementation (" org . li quibase : li quibase - core : 4 . 4 . 3 ") ĊĊĠĠĠ Ġ// ĠReplace ĠLi quibase 's Ġlog Ġoutput Ġformats ĊĠĠĠ Ġtest Implementation (" ch . qos . log back : log back - classic : 1 . 2 . 3 ") ĊĠĠĠ Ġtest Implementation (" org . slf 4 j : jul - to - slf 4 j : 1 . 7 . 3 2 ") Ċ } Ċ Ċ tasks . test Ġ{ ĊĠĠĠ Ġuse JUnit Platform () ĊĠĠĠ Ġtest Logging Ġ{ ĊĠĠĠĠĠĠĠ Ġevents ( Test Log Event . PAS SED , ĠTest Log Event . SKIP PED , ĠTest Log Event . FAILED ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ docker Compose . isRequired By ( tasks . test ) Ċ Ċ val Ġcompose Files Ġ= ĠlistOf ("../ docker - compose . test . yml ", Ġ"../ spring - boot - mybatis / docker - compose . yml ") Ċ Ċ docker Compose Ġ{ ĊĠĠĠ Ġuse Compose Files . set ( compose Files . map Ġ{ Ġroot Dir . resolve ( it ). to Relative String ( project Dir ) Ġ}) Ċ } Ċ Ċ tasks . named < Test >(" test ") Ġ{ ĊĠĠĠ Ġdo First Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdb Info Ġ= Ġdocker Compose . services Infos [" db 0 "] !!. first Container ĊĠĠĠĠĠĠĠ Ġval Ġdb Url Ġ= Ġ" jdbc : postgresql ://${ db Info !!. host }:${ db Info . ports [ 5 4 3 2 ] }/ postgres " ĊĊĠĠĠĠĠĠĠ Ġsystem Property (" ap it esting . li quibase . url ", Ġdb Url ) ĊĠĠĠĠĠĠĠ Ġsystem Property (" ap it esting . li quibase . username ", Ġ" postgres ") ĊĠĠĠĠĠĠĠ Ġsystem Property (" ap it esting . li quibase . password ", Ġ" the - password - for - postgresql - local ") ĊĠĠĠĠĠĠĠ Ġsystem Property (" ap it esting . li quibase . changelog ", Ġ" db / main . xml ") ĊĊĠĠĠĠĠĠĠ Ġval Ġbackend Info Ġ= Ġdocker Compose . services Infos [" backend 0 "] !!. first Container ĊĊĠĠĠĠĠĠĠ Ġsystem Property (" ap it esting . server . base - uri ", Ġ" http ://${ backend Info !!. host }") ĊĠĠĠĠĠĠĠ Ġsystem Property (" ap it esting . server . port ", Ġ"${ backend Info . ports [ 8 0 8 0 ]} ") ĊĠĠĠ Ġ} Ċ } Ċ