package Ġcom . mk ob it . gradle . test . assertj . test kit Ċ Ċ import Ġcom . n ha ar man . mockito _ kotlin . do Return Ċ import Ġcom . n ha ar man . mockito _ kotlin . mock Ċ import Ġcom . n ha ar man . mockito _ kotlin . times Ċ import Ġcom . n ha ar man . mockito _ kotlin . verify Ċ import Ġcom . n ha ar man . mockito _ kotlin . wh enever Ċ import Ġorg . gradle . test kit . runner . Build Task Ċ import Ġorg . gradle . test kit . runner . Task Outcome Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġtests upport . assert No Exception Thrown By Ċ import Ġtests upport . assertThat AssertionError Thrown By Ċ import Ġjava . util . function . Consumer Ċ import Ġjava . util . regex . Pattern Ċ Ċ internal Ġclass ĠBuild Task Assert Test Ġ{ ĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġprivate Ġconst Ġval ĠTEST _ PATH Ġ= Ġ": task Name " ĊĠ Ġ} ĊĊĠ Ġprivate Ġlateinit Ġvar Ġbuild Task Assert : ĠBuild Task Assert ĊĊĠ Ġprivate Ġlateinit Ġvar Ġmock Build Task : ĠBuild Task ĊĊĠ Ġ@ BeforeEach ĊĠ Ġinternal Ġfun ĠsetUp () Ġ{ ĊĠĠĠ Ġmock Build Task Ġ= Ġmock Ġ{ ĊĠĠĠĠĠ Ġon Ġ{ Ġpath Ġ} Ġdo Return ĠTEST _ PATH ĊĠĠĠ Ġ} ĊĠĠĠ Ġbuild Task Assert Ġ= ĠBuild Task Assert ( mock Build Task ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` null Ġconstructor Ġargument `() Ġ{ ĊĠĠĠ Ġval Ġbuild Task Assert Ġ= ĠBuild Task Assert ( null ) ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . isNull () Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . isNotNull Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` FAILED Ġtask Ġoutcome `() Ġ{ ĊĠĠĠ Ġwhenever ( mock Build Task . outcome ). thenReturn ( Task Outcome . FAILED ) ĊĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . has Task Outcome ( Task Outcome . FAILED ) Ġ} ĊĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . is Failed Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is From Cache Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is No Source Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Skipped Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Success Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Up ToDate Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` FROM _ CACHE Ġtask Ġoutcome `() Ġ{ ĊĠĠĠ Ġwhenever ( mock Build Task . outcome ). thenReturn ( Task Outcome . FROM _ CACHE ) ĊĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . has Task Outcome ( Task Outcome . FROM _ CACHE ) Ġ} ĊĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Failed Ġ} ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . is From Cache Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is No Source Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Skipped Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Success Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Up ToDate Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` NO _ SOURCE Ġtask Ġoutcome `() Ġ{ ĊĠĠĠ Ġwhenever ( mock Build Task . outcome ). thenReturn ( Task Outcome . NO _ SOURCE ) ĊĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . has Task Outcome ( Task Outcome . NO _ SOURCE ) Ġ} ĊĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Failed Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is From Cache Ġ} ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . is No Source Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Skipped Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Success Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Up ToDate Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` SKIP PED Ġtask Ġoutcome `() Ġ{ ĊĠĠĠ Ġwhenever ( mock Build Task . outcome ). thenReturn ( Task Outcome . SKIP PED ) ĊĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . has Task Outcome ( Task Outcome . SKIP PED ) Ġ} ĊĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is From Cache Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is No Source Ġ} ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . is Skipped Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Success Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Up ToDate Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` SUCCESS Ġtask Ġoutcome `() Ġ{ ĊĠĠĠ Ġwhenever ( mock Build Task . outcome ). thenReturn ( Task Outcome . SUCCESS ) ĊĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . has Task Outcome ( Task Outcome . SUCCESS ) Ġ} ĊĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Failed Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is From Cache Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is No Source Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Skipped Ġ} ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . is Success Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Up ToDate Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` UP _ TO _ DATE Ġtask Ġoutcome `() Ġ{ ĊĠĠĠ Ġwhenever ( mock Build Task . outcome ). thenReturn ( Task Outcome . UP _ TO _ DATE ) ĊĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . has Task Outcome ( Task Outcome . UP _ TO _ DATE ) Ġ} ĊĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Failed Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is From Cache Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is No Source Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Skipped Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . is Success Ġ} ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . is Up ToDate Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` path Ġequals `() Ġ{ ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . path Is EqualTo ( TEST _ PATH ) Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . path Is EqualTo (": not This Path ") Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` path Ġbegins Ġwith `() Ġ{ ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . path StartsWith (": task ") Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . path StartsWith (": no pe ") Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` path Ġends Ġwith `() Ġ{ ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . path EndsWith (" Name ") Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . path EndsWith (" No pe ") Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` path Ġcontains `() Ġ{ ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . path Contains (" sk Na ") Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . path Contains (" no pe ") Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` path Ġmatches `() Ġ{ ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . path Matches ( Pattern . compile ("^ : task .* $ ")) Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . path Matches ( Pattern . compile ("^ no pe .* ")) Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` path Ġdoes Ġnot Ġmatch `() Ġ{ ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . path DoesNot Match ( Pattern . compile ("^ no pe .* ")) Ġ} ĊĠĠĠ ĠassertThat AssertionError Thrown By Ġ{ Ġbuild Task Assert . path DoesNot Match ( Pattern . compile ("^ : task .* $ ")) Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` path Ġsatisfies `() Ġ{ ĊĠĠĠ Ġval Ġmock Consumer : ĠConsumer < String ?> Ġ= Ġmock () ĊĠĠĠ Ġassert No Exception Thrown By Ġ{ Ġbuild Task Assert . path Satisf ies ( mock Consumer ) Ġ} ĊĠĠĠ Ġverify ( mock Consumer , Ġtimes ( 1 )). accept ( TEST _ PATH ) ĊĠ Ġ} Ċ } Ċ