package Ġde . r ki . cor on aw arn app . bug reporting . c ensors . dc ct icket ing Ċ Ċ import Ġde . r ki . cor on aw arn app . dc ct icket ing . core . transaction . D cc Ticket ing Validation Condition Ċ import Ġio . kot est . matchers . shouldBe Ċ import Ġkotlinx . coroutines . test . run Blocking Test Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġtest helpers . Base Test Ċ Ċ @ Suppress (" Max Line Length ") Ċ class ĠD cc Ticket ing Jwt C ensor Test Ġ: ĠBaseTest () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġraw Jwt Ġ= Ġ" raw AccessToken " ĊĊĠĠĠ Ġprivate Ġval Ġvc Ġ= ĠD cc Ticket ing Validation Condition ( ĊĠĠĠĠĠĠĠ Ġhash Ġ= Ġ" hash ", Ġ// Ġnot Ġc ens ored ĊĠĠĠĠĠĠĠ Ġlang Ġ= Ġ" lang ", Ġ// Ġnot Ġc ens ored ĊĠĠĠĠĠĠĠ Ġf nt Ġ= Ġ" family Ġname ", ĊĠĠĠĠĠĠĠ Ġg nt Ġ= Ġ" given Ġname ", ĊĠĠĠĠĠĠĠ Ġdo b Ġ= Ġ" 1 9 8 1 - 0 3 - 2 0 ", ĊĠĠĠĠĠĠĠ Ġtype Ġ= ĠlistOf (" v ", Ġ" r "), Ġ// Ġnot Ġc ens ored ĊĠĠĠĠĠĠĠ Ġco a Ġ= Ġ" ES ", ĊĠĠĠĠĠĠĠ Ġro a Ġ= Ġ" b ale ar ic Ġis lands ", ĊĠĠĠĠĠĠĠ Ġcod Ġ= Ġ" DE ", ĊĠĠĠĠĠĠĠ Ġro d Ġ= Ġ" Ber lin ", ĊĠĠĠĠĠĠĠ Ġcategory Ġ= ĠlistOf (" air Ġtravel ", Ġ" train "), ĊĠĠĠĠĠĠĠ Ġvalidation Clock Ġ= Ġ" 2 0 2 1 - 1 1 - 3 0 T 1 2 : 5 8 : 2 3 . 0 5 2 Z ", ĊĠĠĠĠĠĠĠ Ġvalid From Ġ= Ġ" 2 0 2 1 - 1 0 - 3 0 T 1 2 : 0 0 : 2 3 . 0 5 2 Z ", ĊĠĠĠĠĠĠĠ Ġvalid To Ġ= Ġ" 2 0 2 1 - 1 2 - 3 0 T 1 3 : 5 8 : 2 3 . 0 5 2 Z ", ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` c ensor ing Ġreplaces Ġraw ĠJWT `() Ġ= Ġrun Blocking Test Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinstance Ġ= ĠD cc Ticket ing Jwt C ensor () ĊĠĠĠĠĠĠĠ Ġinstance . add Jwt ( raw Jwt ) ĊĠĠĠĠĠĠĠ Ġval Ġfilter Me Ġ= Ġ" Logging Ġ$ raw Jwt Ġfor Ġdebugging " ĊĠĠĠĠĠĠĠ Ġinstance . check Log ( filter Me ) !!. compile () !!. c ens ored ĠshouldBe Ġ" Logging Ġticket ing / raw Jwt Ġfor Ġdebugging " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` c ensor ing Ġreplaces Ġvc Ġattributes `() Ġ= Ġrun Blocking Test Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinstance Ġ= ĠD cc Ticket ing Jwt C ensor () ĊĊĠĠĠĠĠĠĠ Ġinstance . add Vc ( vc ) ĊĠĠĠĠĠĠĠ Ġval Ġfilter Me Ġ= Ġ" Logging Ġ$ vc Ġfor Ġdebugging " ĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġinstance . check Log ( filter Me ) !!. compile () !!. c ens ored ĊĠĠĠĠĠĠĠ Ġresult ĠshouldBe Ġ" Logging ĠD cc Ticket ing Validation Condition ( hash = hash , Ġlang = lang , Ġf nt = ticket ing / family Name , Ġg nt = ticket ing / given Name , Ġdo b = ticket ing / date OfBirth , Ġtype =[ v , Ġr ], Ġco a = ticket ing / country Of Arrival , Ġro a = ticket ing / region Of Arrival , Ġcod = ticket ing / country Of Depart ure , Ġro d = ticket ing / region Of Depart ure , Ġcategory =[ ticket ing / category 0 , Ġticket ing / category 1 ], Ġvalidation Clock = ticket ing / validation Clock , Ġvalid From = ticket ing / valid From , Ġvalid To = ticket ing / valid To ) Ġfor Ġdebugging " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` no Ġc ensor ing Ġreturns Ġnull `() Ġ= Ġrun Blocking Test Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinstance Ġ= ĠD cc Ticket ing Jwt C ensor () ĊĠĠĠĠĠĠĠ Ġinstance . add Vc ( vc ) ĊĠĠĠĠĠĠĠ Ġinstance . add Jwt ( raw Jwt ) ĊĠĠĠĠĠĠĠ Ġval Ġfilter Me Ġ= Ġ" Nothing Ġneeds Ġto Ġbe Ġc ens ored Ġhere " ĊĠĠĠĠĠĠĠ Ġinstance . check Log ( filter Me ) ĠshouldBe Ġnull ĊĠĠĠ Ġ} Ċ } Ċ