package Ġcom . example . test 1 2 3 Ċ Ċ import Ġcom . fasterxml . jackson . databind . ObjectMapper Ċ import Ġcom . fasterxml . jackson . databind . Serialization Feature Ċ import Ġcom . fasterxml . jackson . datatype . js r 3 1 0 . Java Time Module Ċ import Ġorg . springframework . http . MediaType Ċ import Ġorg . springframework . test . web . servlet . request . Mock HttpServletRequest Builder Ċ Ċ fun ĠAny ?. toJson (): ĠString Ġ= ĠObjectMapper (). apply Ġ{ ĊĠĠĠ Ġconfigure ( Serialization Feature . WRITE _ DURATION S _ AS _ TIMESTAMP S , Ġfalse ) ĊĠĠĠ Ġregister Module ( Java Time Module ()) Ċ }. writeValue AsString ( this ) Ċ Ċ fun ĠMock HttpServletRequest Builder . json ( body : ĠAny ): ĠMock HttpServletRequest Builder Ġ= ĊĠĠĠ Ġthis . contentType ( MediaType . APPLICATION _ JSON ). accept ( MediaType . APPLICATION _ JSON ). content ( body . toJson ()) ĊĊ