package Ġcom . ec . aq soft . arch . ex ag onal . ddd . order Ċ Ċ import Ġcom . ec . aq soft . arch . ex ag onal . ddd . order . domain . Order Ċ import Ġcom . ec . aq soft . arch . ex ag onal . ddd . order . domain . service . Order Service Ċ import Ġcom . ec . aq soft . arch . ex ag onal . ddd . order . infrastructure . persistence . repositories . Order Repository Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito Ċ import Ġorg . springframework . boot . test . context . SpringBootTest Ċ Ċ @ SpringBootTest Ċ class ĠOrder Application Tests Ġ{ Ċ ĉ @ Mock Ċ ĉ private Ġlateinit Ġvar Ġorder Repository : ĠOrder Repository ĊĊ ĉ private Ġvar Ġorder Service : ĠOrder Service ? Ġ= Ġnull ĊĊ ĉ @ BeforeEach Ċ ĉ fun Ġsetup () Ġ{ Ċĉ ĉ order Service Ġ= ĠOrder Service ( order Repository ) Ċ ĉ } Ċ ĉ @ Test Ċ ĉ fun Ġcontext Load s () Ġ{ Ċĉ ĉ Mockito .` when `( order Repository . find Order ById ( 1 )). thenReturn ( Order ( 1 , 1 ," J uan ", 2 )); Ċĉ ĉ var Ġorder Ġ= Ġthis . order Service ?. find Order ById ( 1 ) Ċĉ ĉ assert ( order Ġ!= Ġnull Ġ&& Ġorder . name Rt . equals (" J uan ")) ĊĊ ĉ } Ċ Ċ } Ċ