package Ġno . nav . k 9 . wire mock Ċ Ċ import Ġcom . github . tom ake hur st . wire mock . Wire Mock Server Ċ import Ġcom . github . tom ake hur st . wire mock . client . Wire Mock Ċ import Ġcom . github . tom ake hur st . wire mock . client . Wire Mock . equalTo Ċ import Ġcom . github . tom ake hur st . wire mock . matching . Anything Pattern Ċ import Ġio . ktor . http .* Ċ import Ġno . nav . hel se . d us se ld or f . test support . wire mock . Wire Mock Builder Ċ Ċ internal Ġconst Ġval Ġk 9 Opp sl ag Path Ġ= Ġ"/ k 9 - sel v bet j ening - op ps lag - mock " Ċ private Ġconst Ġval Ġk 9 Mel lo ml ag ring Path Ġ= Ġ"/ k 9 - mel lo ml ag ring - mock " Ċ Ċ internal Ġfun ĠWire Mock Builder . k 9 Et ter sending Api Config () Ġ= Ġwire Mock Configuration Ġ{ ĊĠĠĠ Ġit ĊĠĠĠĠĠĠĠ Ġ. extensions ( S oker Response Transformer ()) ĊĠĠĠĠĠĠĠ Ġ. extensions ( K 9 Mel lo ml ag ring Response Transformer ()) Ċ } ĊĊ Ċ internal Ġfun ĠWire Mock Server . stub K 9 Opp sl ag S oker ( ĊĠĠĠ ĠstatusCode : ĠHttpStatusCode Ġ= ĠHttpStatusCode . OK , ĊĠĠĠ Ġresponse Body : ĠString ? Ġ= Ġnull ĊĠĠĠ Ġ) Ġ: ĠWire Mock Server Ġ{ ĊĠĠĠ Ġval Ġresponse Builder Ġ= ĠWire Mock . a Response () ĊĠĠĠĠĠĠĠ Ġ. with Header (" Content - Type ", Ġ" application / json ") ĊĠĠĠĠĠĠĠ Ġ. with Status ( statusCode . value ) ĊĠĠĠ ĠWire Mock . stub For ( ĊĠĠĠĠĠĠĠ ĠWire Mock . get ( Wire Mock . urlPath Matching ("$ k 9 Opp sl ag Path / .* ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Header ( HttpHeaders . Authorization , ĠAny thing Pattern ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with QueryParam (" a ", ĠequalTo (" akt Ã¸ r _ id ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with QueryParam (" a ", ĠequalTo (" for nav n ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with QueryParam (" a ", ĠequalTo (" mel lom nav n ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with QueryParam (" a ", ĠequalTo (" et tern av n ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with QueryParam (" a ", ĠequalTo (" f Ã¸ d sel sd ato ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. willReturn ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresponse Body ?. let Ġ{ Ġresponse Builder . with Body ( it ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġresponse Builder . with Transform ers (" k 9 - op ps lag - so ker ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġreturn Ġthis Ċ } Ċ Ċ private Ġfun ĠWire Mock Server . stub Health Endpoint ( ĊĠĠĠ Ġpath Ġ: ĠString Ċ ) Ġ: ĠWire Mock Server { ĊĠĠĠ ĠWire Mock . stub For ( ĊĠĠĠĠĠĠĠ ĠWire Mock . get ( Wire Mock . urlPath Matching (" .* $ path ")). willReturn ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠWire Mock . a Response () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Status ( 2 0 0 ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġreturn Ġthis Ċ } Ċ Ċ internal Ġfun ĠWire Mock Server . stub Opp sl ag Health () Ġ= Ġstub Health Endpoint ("$ k 9 Opp sl ag Path / health ") Ċ Ċ internal Ġfun ĠWire Mock Server . stub K 9 Mel lo ml ag ring () Ġ: ĠWire Mock Server { ĊĠĠĠ ĠWire Mock . stub For ( ĊĠĠĠĠĠĠĠ ĠWire Mock . any ( Wire Mock . url Matching (" .* $ k 9 Mel lo ml ag ring Path / v 1 / d okument .* ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. willReturn ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠWire Mock . a Response () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Transform ers (" K 9 Mel lo ml ag ring Response Transformer ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġreturn Ġthis Ċ } Ċ Ċ internal Ġfun ĠWire Mock Server . get K 9 Opp sl ag Url () Ġ= ĠbaseUrl () Ġ+ Ġk 9 Opp sl ag Path Ċ internal Ġfun ĠWire Mock Server . get K 9 Mel lo ml ag ring Url () Ġ= ĠbaseUrl () Ġ+ Ġk 9 Mel lo ml ag ring Path Ġ+ Ġ"/ v 1 / d okument "