package Ġio . code kv ast . int ake . file _ import . impl Ċ Ċ import Ġcom . n ha ar man . mock it ok otlin 2 .* Ċ import Ġlombok . Required ArgsConstructor Ċ import Ġorg . hamcrest . Core Matchers .` is ` Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . params . Parameterized Test Ċ import Ġorg . junit . jupiter . params . provider . Csv Source Ċ import Ġorg . mockito . Argument Matchers . any String Ċ import Ġorg . mockito . Mockito Ċ Ċ /** Ġ@ author Ġol le . hall in @ cr isp . se Ċ Ġ*/ Ċ @ Required ArgsConstructor Ċ class ĠSynt hetic Signature Service Test Ġ{ ĊĠĠĠ Ġprivate Ġval Ġdao Ġ= Ġmock < Synt hetic Signature DAO >() ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġsynthetic Signature Service : ĠSynt hetic Signature Service ĊĊĠĠĠ Ġ@ BeforeEach ĊĠĠĠ Ġfun Ġbefore Test () Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( dao . synt hetic Patterns ()). thenReturn ( emptyList ()) ĊĠĠĠĠĠĠĠ Ġsynthetic Signature Service Ġ= ĠSynt hetic Signature Service ( dao ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Csv Source ( delimiter Ġ= Ġ'; ', Ġvalue Ġ= Ġ[" true ; Ġfoo ", Ġ" true ; Ġbar ", Ġ" false ; Ġbaz "]) ĊĠĠĠ Ġfun Ġshould _ compose _ patterns ( expected : ĠBoolean , Ġsignature : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġgiven ĊĠĠĠĠĠĠĠ Ġval Ġp 1 Ġ= ĠSynt hetic Signature Pattern ( 1 L , Ġ" .* foo .* ") ĊĠĠĠĠĠĠĠ Ġval Ġp 2 Ġ= ĠSynt hetic Signature Pattern ( 2 L , Ġ" .* bar .* ") ĊĠĠĠĠĠĠĠ Ġwhenever ( dao . synt hetic Patterns ()). thenReturn ( listOf ( p 1 , Ġp 2 )) ĊĊĠĠĠĠĠĠĠ Ġ// Ġwhen ĊĠĠĠĠĠĠĠ Ġval Ġis Synt hetic Method Ġ= Ġsynthetic Signature Service . is Synt hetic Method ( signature ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġthen ĊĠĠĠĠĠĠĠ ĠassertThat ( is Synt hetic Method , Ġ` is `( expected )) ĊĠĠĠĠĠĠĠ Ġverify ( dao , ĠMockito . never ()). reject Pattern ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġany < Synt hetic Signature Pattern >(), Ġany String () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġshould _ reject _ bad _ patterns () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġgiven ĊĠĠĠĠĠĠĠ Ġval Ġp 1 Ġ= ĠSynt hetic Signature Pattern ( 1 L , Ġ" .* foo .* (" ) ĊĠĠĠĠĠĠĠ Ġval Ġp 2 Ġ= ĠSynt hetic Signature Pattern ( 2 L , Ġ" .* bar .* ") ĊĠĠĠĠĠĠĠ Ġwhenever ( dao . synt hetic Patterns ()). thenReturn ( listOf ( p 1 , Ġp 2 )) ĊĊĠĠĠĠĠĠĠ Ġ// Ġwhen , Ġthen ĊĠĠĠĠĠĠĠ ĠassertThat ( synt hetic Signature Service . is Synt hetic Method (" foo "), Ġ` is `( false )) ĊĠĠĠĠĠĠĠ ĠassertThat ( synt hetic Signature Service . is Synt hetic Method (" bar "), Ġ` is `( true )) ĊĠĠĠĠĠĠĠ Ġverify ( dao ). reject Pattern ( eq ( p 1 ), Ġany String ()) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Csv Source ( delimiter Ġ= Ġ'; ', ĊĠĠĠĠĠĠĠĠĠĠĠ Ġvalue Ġ= Ġ[ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" false ; Ġfoo . ()", Ġ Ġ// ĠConstructor Ġof ĠScala Ġcompanion Ġobj , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" false ; Ġfoo .. bar ()", Ġ Ġ// ĠMethod Ġin ĠScala Ġcompanion Ġobj , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" false ; Ġfoo . bar \$ 1 ()", Ġ Ġ// ĠAn onymous Ġinner Ġcl , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" false ; Ġfoo . bar ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . Assets . play \$ api \$ http \ ${ Slack Signature . Header Names }\ $_ setter _\ $ LOCATION _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . Assets Builder .. anonfun . at . 1 .. anonfun . apply . 2 .. anonfun . 7 . apply ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . Assets Builder . play \$ api \$ mvc \$ Results \ $_ setter _\ $ Failed Dependency _\ $ eq ( play . api . mvc . Results . Status )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Admin . CONTENT _ MD 5 ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . application . play \$ api \$ http \$ Header Names \ $_ setter _\ $ IF _ RANGE _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . application Open . play \$ api \$ mvc \$ Results \ $_ setter _\ $ Failed Dependency _\ $ eq ( play . api . mvc . Results . Status )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Authenticate . play \$ api \$ http \$ Header Names \ $_ setter _\ $ CONTENT _ MD 5 _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Content Feed . play \$ api \$ http \$ Header Names \ $_ setter _\ $ IF _ NONE _ MATCH _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Esc en ic Feed . play \$ api \$ http \$ Header Names \ $_ setter _\ $ ACCEPT _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Esc en ic Feed . play \$ api \$ http \$ Http Protocol \ $_ setter _\ $ HTTP _ 1 _ 0 _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Esc en ic Feed . play \$ api \$ http \$ Status \ $_ setter _\ $ OK _\ $ eq ( int )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . health graph . Health Graph Connector . play \$ api \$ http \$ Status \ $_ setter _\ $ RESET _ CONTENT _\ $ eq ( int )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . health graph . Health Graph Mock . play \$ api \$ mvc \$ Results \ $_ setter _\ $ Method Not Allowed _\ $ eq ( play . api . mvc . Results . Status )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Log Service . play \$ api \$ http \$ Header Names \ $_ setter _\ $ ALLOW _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . Mobile application . play \$ api \$ http \$ Header Names \ $_ setter _\ $ AGE _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . S mp Feed . play \$ api \$ http \$ Status \ $_ setter _\ $ FAILED _ DEPEND ENCY _\ $ eq ( int )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . S mp Feed . play \$ api \$ mvc \$ Results \ $_ setter _\ $ Method Not Allowed _\ $ eq ( play . api . mvc . Results . Status )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . customer 1 . application . X xx Y yy .\ $ amp ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . Default . play \$ api \$ http \$ Header Names \ $_ setter _\ $ MAX _ FOR WAR DS _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcontrollers . External Assets . play \$ api \$ http \$ Header Names \ $_ setter _\ $ AUTHORIZATION _\ $ eq ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 1 . Foo Config .. Enh ancer By Spring CG LIB .. 9 6 aac 8 7 5 . CG LIB \$ BIND _ CALLBACK S ( java . lang . Object )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 1 . Foo Config .. Fast Class By Spring CG LIB .. 7 3 e 1 cc 5 a . getIndex ( org . springframework . cg lib . core . Signature )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Events .. se \$ cr isp \$ signup 4 \$ controllers \$ Events \ $\ $ all Guest s ( se . cr isp . signup 4 . models . Event )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Events .. se \$ cr isp \$ signup 4 \$ controllers \$ Events \ $\ $ all Members ( se . cr isp . signup 4 . models . Event )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Events Sec ured .. se \$ cr isp \$ signup 4 \$ controllers \$ Events Sec ured \ $\ $ is Reminder ToBe Sent ( jp . t 2 v . lab . play 2 . stack c . Request With Attributes )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Facebook Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Facebook Auth \ $\ $ FACE BOOK _ AUTHENT ICATION _ URL ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Facebook Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Facebook Auth \ $\ $ FACE BOOK _ CLIENT _ ID \$ l zy compute ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Facebook Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Facebook Auth \ $\ $ FACE BOOK _ CLIENT _ ID ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Facebook Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Facebook Auth \ $\ $ get EmailAddress ( java . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Facebook Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Facebook Auth \ $\ $ request AccessToken ( java . lang . String , Ġjava . lang . String )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Google Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Google Auth \ $\ $ GOOGLE _ AUTHENT ICATION _ URL ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Google Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Google Auth \ $\ $ GOOGLE _ CLIENT _ ID \$ l zy compute ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Google Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Google Auth \ $\ $ GOOGLE _ CLIENT _ ID ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Google Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Google Auth \ $\ $ GOOGLE _ CLIENT _ SECRET \$ l zy compute ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Google Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Google Auth \ $\ $ GOOGLE _ CLIENT _ SECRET ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Google Auth .. se \$ cr isp \$ signup 4 \$ controllers \$ Google Auth \ $\ $ GOOGLE _ TOKEN _ URL ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Part icip ations .. se \$ cr isp \$ signup 4 \$ controllers \$ Part icip ations \ $\ $ as Log Message ( se . cr isp . signup 4 . models . Part icipation , Ġplay . api . i 1 8 n . Lang )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Users Sec ured .. se \$ cr isp \$ signup 4 \$ controllers \$ Users Sec ured \ $\ $ prevent Permission ToBe Changed ( se . cr isp . signup 4 . models . User )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Users Sec ured . HTTP _ VERSION _ NOT _ SUPPORTED ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . controllers . Users Sec ured . NOT _ MODI FIED ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . services . Event Reminder Actor . se \$ cr isp \$ signup 4 \$ services \$ Event Reminder Actor \ $\ $ check Events ( se . cr isp . signup 4 . models . User )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . services . Event Reminder Actor . se \$ cr isp \$ signup 4 \$ services \$ Event Reminder Actor \ $\ $ rem ind Participant ( se . cr isp . signup 4 . models . Event , Ġse . cr isp . signup 4 . models . User , Ġse . cr isp . signup 4 . models . User )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . services . Event Reminder Actor . se \$ cr isp \$ signup 4 \$ services \$ Event Reminder Actor \ $\ $ rem ind Participants ( se . cr isp . signup 4 . models . Event , Ġse . cr isp . signup 4 . models . User )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . services . Mail Reminder .. se \$ cr isp \$ signup 4 \$ services \$ Mail Reminder \ $\ $ create Cancellation Message ( se . cr isp . signup 4 . models . Event , Ġse . cr isp . signup 4 . models . User )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . services . Mail Reminder .. se \$ cr isp \$ signup 4 \$ services \$ Mail Reminder \ $\ $ create Reminder Message ( se . cr isp . signup 4 . models . Event , Ġse . cr isp . signup 4 . models . User )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . services . Mail Reminder .. se \$ cr isp \$ signup 4 \$ services \$ Mail Reminder \ $\ $ sendMessage ( se . cr isp . signup 4 . models . Event , Ġse . cr isp . signup 4 . models . User , Ġscala . Function 2 )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġcustomer 2 . views . html . membership s . edit .. se \$ cr isp \$ signup 4 \$ views \$ html \$ membership s \$ edit \ $\ $ field \$ 1 ( java . lang . String , Ġplay . api . data . Form )", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġfoo \ $\ $ bar ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġsupport . customer 1 . application . domain . sale . Product . copy \$ default \$ 8 ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġsupport . customer 1 . application . view . mag azine . Article .\ $ less init \$ greater \$ default \$ 1 0 ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġviews . html . customer 1 . application . export . header . copy \$ default \$ 1 ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġviews . html . default pages . dev Error . copy \$ default \$ 1 ()", ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" true ; Ġio . code kv ast . back office . facts . Collection Started . can Equal ( java . lang . Object ) "] ĊĠĠĠ Ġ) ĊĠĠĠ Ġfun Ġshould _ have _ de cent _ fallback s ( expected : ĠBoolean , Ġsignature : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( dao . synt hetic Patterns ()). thenReturn ( emptyList ()) ĊĠĠĠĠĠĠĠ ĠassertThat ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsynthetic Signature Service . is Synt hetic Method ( signature ), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ` is `( expected ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} Ċ }