package Ġno . nav . oms org sp enger . test utils . 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 . matching . Anything Pattern Ċ import Ġcom . github . tom ake hur st . wire mock . matching . Regex Pattern Ċ Ċ private Ġconst Ġval ĠbasePath Ġ= Ġ"/ dok ark iv proxy - mock " Ċ private Ġconst Ġval Ġjournal post Path Ġ= Ġ"$ basePath / rest / journal post api / v 1 / journal post / .* " Ċ Ċ private Ġfun ĠWire Mock Server . stub K ny tt Til An nen S ak K 9 () Ġ= Ġalso Ġ{ Ġwire Mock Server Ġ-> ĊĠĠĠ Ġwire Mock Server . stub For ( Wire Mock . put ( Wire Mock . url Matching (" .* $ journal post Path .* ")) ĊĠĠĠĠĠĠĠ Ġ. with Header (" Authorization ", ĠRegex Pattern ("^ Bearer Ġ. +$ ")) ĊĠĠĠĠĠĠĠ Ġ. with Header (" Content - Type ", ĠWire Mock . equalTo (" application / json ")) ĊĠĠĠĠĠĠĠ Ġ. with Header (" Accept ", ĠWire Mock . equalTo (" application / json ")) ĊĠĠĠĠĠĠĠ Ġ. with Header (" Nav - Consumer - Id ", ĠWire Mock . equalTo (" oms org sp enger - journal for ing ")) ĊĠĠĠĠĠĠĠ Ġ. with Header (" Nav - Call id ", ĠAny thing Pattern ()) ĊĠĠĠĠĠĠĠ Ġ. with RequestBody ( Wire Mock . matching Json Path (" $. sak stype ", ĠWire Mock . equalTo (" F AG SA K "))) ĊĠĠĠĠĠĠĠ Ġ. with RequestBody ( Wire Mock . matching Json Path (" $. f ags ak system ", ĠWire Mock . equalTo (" K 9 "))) ĊĠĠĠĠĠĠĠ Ġ. with RequestBody ( Wire Mock . matching Json Path (" $. t ema ", ĠWire Mock . equalTo (" O MS "))) ĊĠĠĠĠĠĠĠ Ġ. with RequestBody ( Wire Mock . matching Json Path (" $. journal fo eren de En het ", ĠWire Mock . equalTo (" 9 9 9 9 "))) ĊĠĠĠĠĠĠĠ Ġ. with RequestBody ( Wire Mock . matching Json Path (" $. br uk er . id Type ", ĠWire Mock . equalTo (" FN R "))) ĊĠĠĠĠĠĠĠ Ġ. with RequestBody ( Wire Mock . matching Json Path (" $. br uk er . id ")) ĊĠĠĠĠĠĠĠ Ġ. willReturn ( Wire Mock . a Response (). with Status ( 2 0 0 ). with Body (""" {" ny Journal post Id ":" 1 2 3 4 1 2 3 4 1 2 3 4 "} "" "))) Ċ } Ċ Ċ private Ġfun ĠWire Mock Server . stub Is Ready () Ġ= Ġalso Ġ{ Ġwire Mock Server Ġ-> ĊĠĠĠ Ġwire Mock Server . stub For ( ĊĠĠĠĠĠĠĠ ĠWire Mock . get ("$ basePath / is Ready ") ĊĠĠĠĠĠĠĠ Ġ. willReturn ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠWire Mock . a Response () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. with Status ( 2 0 0 ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) Ċ } Ċ Ċ internal Ġfun ĠWire Mock Server . stub D ok ark iv proxy () Ġ= Ġstub Is Ready (). stub K ny tt Til An nen S ak K 9 () Ċ internal Ġfun ĠWire Mock Server . dok ark iv proxy BaseUrl () Ġ= ĠbaseUrl () Ġ+ ĠbasePath