package Ġgraphql . n adel . tests . hooks Ċ Ċ import Ġgraphql . n adel . N adel Ċ import Ġgraphql . n adel . tests . Engine Test Hook Ċ import Ġgraphql . n adel . tests . Gateway Schema W iring Factory Ċ import Ġgraphql . n adel . tests . Use Hook Ċ import Ġjava . io . File Ċ Ċ interface ĠGateway Scalar Engine Hook Ġ: ĠEngine Test Hook Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġmake N adel ( builder : ĠN adel . Builder ): ĠN adel . Builder Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġsuper . make N adel ( builder ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. overall W iring Factory ( Gateway Schema W iring Factory ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. underlying W iring Factory ( Gateway Schema W iring Factory ()) ĊĠĠĠ Ġ} Ċ } Ċ Ċ /** Ċ Ġ* ĠAuto Ġupdates Ġthis Ġfile Ġto Ġapply Ġthe Ġhook Ġto Ġall Ġthe Ġtests Ġunder Ġ` test / src / test / resources / fixtures / scal ars ` Ċ Ġ* Ċ Ġ* ĠWhy Ġspend Ġ 1 Ġminute Ġwhen Ġyou Ġcan Ġspend Ġ 1 0 Ġminutes Ġautom ating Ġit . Ċ Ġ* Ċ Ġ* Ġ-- ĠAl bert ĠE inst ein Ċ Ġ* Ċ Ġ* ĠNow Ġthat ĠI 've Ġdone Ġthis âĢ¦ Ġperhaps Ġthis Ġpoints Ġto Ġa Ġgeneric Ġsolution Ġelsewhere âĢ¦ Ċ Ġ*/ Ċ fun Ġmain () Ġ{ ĊĠĠĠ Ġval Ġpath Ġ= ĠClassLoader . getSystem ClassLoader (). getResource ("") !!. path ĊĠĠĠ Ġval Ġproject Dir Ġ= Ġpath . substring Before Last (" test / build /") ĊĊĠĠĠ Ġval Ġthis File Ġ= ĠFile ( project Dir , Ġ" test / src / test / kotlin / graphql / n adel / tests / hooks / scalar - transforms . kt ") ĊĠĠĠ Ġval Ġscalar Test Dir Ġ= ĠFile ( project Dir , Ġ" test / src / test / resources / fixtures / scal ars ") ĊĊĠĠĠ Ġval Ġcode Gen Separator Ġ= Ġ"// ĠHello ĠWorld " ĊĠĠĠ Ġval Ġfile Text Ġ= Ġthis File . read Text () ĊĠĠĠĠĠĠĠ Ġ. substring Before Last ( code Gen Separator ) ĊĠĠĠĠĠĠĠ Ġ. trim End () ĊĊĠĠĠ Ġval Ġtest Slug s Ġ= Ġscalar Test Dir . list Files () !! Ġ// ĠWhy Ġthe Ġf uck Ġis Ġthis Ġnullable ĊĠĠĠĠĠĠĠ Ġ. filter Ġ{ Ġit . extension Ġ== Ġ" yml " Ġ|| Ġit . extension Ġ== Ġ" yaml " Ġ} ĊĠĠĠĠĠĠĠ Ġ. map ( File :: name Without Extension ) ĊĊĠĠĠ Ġval Ġtest Hooks Code Ġ= Ġtest Slug s ĊĠĠĠĠĠĠĠ Ġ. join ToString ( separator Ġ= Ġ"\ n \ n ") Ġ{ Ġtest Slug Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ@ Use Hook ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclass Ġ`$ test Slug ` Ġ: Ġ${ Gateway Scalar Engine Hook :: class . simple Name } ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġthis File . write Text ( ĊĠĠĠĠĠĠĠ Ġsequence Of ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfile Text , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcode Gen Separator , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtest Hooks Code , ĊĠĠĠĠĠĠĠ Ġ). join ToString ("\ n \ n "). trim End () Ġ+ Ġ"\ n " ĊĠĠĠ Ġ) Ċ } Ċ Ċ // ĠDon 't Ġdelete Ġthese Ġcomments Ġor Ġelse Ġthe Ġfabric Ġof Ġthe Ġuniverse Ġwill Ġtear Ġapart Ċ Ċ // ĠHello ĠWorld Ċ Ċ @ Use Hook Ċ class Ġ` date - time - scalar - as - input - type ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` date - time - scalar - is - pas sthrough - and - can - be - anything - tech n ically ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` indexed - hy dr ating - using - json - data - as - arg ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` long - scalar - as - input - type ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` hy dr ating - using - json - data - as - arg ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` long - scalar - as - output - type ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` date - time - scalar - as - output - type ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` url - scalar - as - output - type ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` ren aming - date - time - typed - field ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` ren aming - json - typed - field ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` hy dr ating - json - data ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` url - scalar - as - input - type ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` long - scalar - is - pas sthrough - and - can - be - anything - tech n ically ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` ren aming - url - typed - field ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` custom - json - scalar - as - output - type ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` hy dr ating - using - long - as - arg ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` url - scalar - is - pas sthrough - and - can - be - anything - tech n ically ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` hy dr ating - using - url - as - arg ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` hy dr ating - using - date - time - as - arg ` Ġ: ĠGateway Scalar Engine Hook Ċ Ċ @ Use Hook Ċ class Ġ` custom - json - scalar - as - input - type ` Ġ: ĠGateway Scalar Engine Hook Ċ