/* Ċ Ġ* ĠCopyright Ġ 2 0 2 0 ĠZ UP ĠIT ĠSER V IC OS ĠEM ĠT EC NO LOG IA ĠE ĠIN OV AC AO ĠSA Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġbr . com . z up . be agle . android . operation Ċ Ċ import Ġbr . com . z up . be agle . android . Base Test Ċ import Ġbr . com . z up . be agle . android . logger . Be agle Message Logs Ċ import Ġio . mock k . Runs Ċ import Ġio . mock k . every Ċ import Ġio . mock k . just Ċ import Ġio . mock k . mock k Object Ċ import Ġio . mock k . verify Ċ import Ġorg . json . JSONArray Ċ import Ġorg . junit . jupiter . api . Assertions . assertNotNull Ċ import Ġorg . junit . jupiter . api . Assertions . assertNull Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ Ċ class ĠOperation Resolver Test Ġ: ĠBaseTest () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġfunction Resolver : ĠOperation Resolver ĊĊĠĠĠ Ġ@ BeforeEach ĊĠĠĠ Ġoverride Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . setUp () ĊĠĠĠĠĠĠĠ Ġfunction Resolver Ġ= ĠOperation Resolver () ĊĊĠĠĠĠĠĠĠ Ġmock k Object ( Be agle Message Logs ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġshould _ execute _ all _ functions () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" divide ", Ġ 1 , Ġ 2 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" multiply ", Ġ 1 , Ġ 2 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" subtract ", Ġ 1 , Ġ 2 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" contains ", ĠJSONArray ( listOf ( 1 )), Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" insert ", ĠJSONArray ( listOf ( 1 )), Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" remove ", ĠJSONArray ( listOf ( 1 )), Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" remove Index ", ĠJSONArray ( listOf ( 1 )), Ġ 0 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" and ", Ġtrue )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" or ", Ġtrue )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" not ", Ġtrue )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" condition ", Ġtrue , Ġtrue , Ġtrue )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" eq ", Ġ 1 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" gt ", Ġ 1 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" gte ", Ġ 1 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" lt ", Ġ 1 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" lte ", Ġ 1 , Ġ 1 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" concat ", Ġ" a ", Ġ" b ")) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" capitalize ", Ġ" a ")) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" uppercase ", Ġ" a ")) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" lowercase ", Ġ" a ")) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" substr ", Ġ" aaaa aaa ", Ġ 0 , Ġ 2 )) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" isNull ", Ġ" a ")) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" isEmpty ", Ġ" a ")) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( function Resolver . execute (" length ", Ġ" a ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġexecute _ should _ log _ function _ that _ does _ not _ exists () Ġ{ ĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĠBe agle Message Logs . function WithName DoesNotExist ( any ()) Ġ} Ġjust ĠRuns ĊĊĠĠĠĠĠĠĠ ĠassertNull ( function Resolver . execute (" aa ", Ġ"")) ĊĊĠĠĠĠĠĠĠ Ġverify Ġ{ ĠBe agle Message Logs . function WithName DoesNotExist (" aa ") Ġ} ĊĠĠĠ Ġ} Ċ }