package Ġio . kf leet . travel er . service . repos ĊĊ Ċ import Ġio . kf leet . commands . Command Response Ċ import Ġio . kf leet . commands . Command Status Ċ import Ġio . kf leet . common . Web Client Util Ċ import Ġorg . apache . kafka . common . serialization . String Serializer Ċ import Ġorg . apache . kafka . streams . state . Host Info Ċ import Ġorg . junit . jupiter . api . Before All Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . mockito . BDD Mockito .* Ċ import Ġorg . mockito . Inject Mocks Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito Annotations Ċ import Ġorg . springframework . cloud . stream . binder . kafka . streams . Interactive Query Service Ċ import Ġreactor . core . publisher . Mono Ċ import Ġreactor . test . Step Verifier ĊĊ Ċ class ĠCommands Response Repository Test Ġ{ ĊĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġinteractive Q Service : ĠInteractive Query Service ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġweb client Utils : ĠWeb Client Util ĊĊĠĠĠ Ġ@ Inject Mocks ĊĠĠĠ Ġlateinit Ġvar Ġcommand Response Repo : ĠCommands Response Repository ĊĊĠĠĠ Ġ@ Before All ĊĠĠĠ Ġfun Ġinit Mocks () Ġ{ ĊĠĠĠĠĠĠĠ ĠMockito Annotations . init Mocks ( this ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfind Command Response ById () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġc Response Ġ= ĠCommand Response . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcommand Id Ġ= Ġ" 1 " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstatus Ġ= ĠCommand Status . SUCCEEDED ĊĠĠĠĠĠĠĠĠĠĠĠ Ġress ource Id Ġ= Ġ" 2 " ĊĠĠĠĠĠĠĠ Ġ}. build () ĊĊĠĠĠĠĠĠĠ Ġval Ġhost Info Ġ= ĠHost Info (" localhost ", Ġ 8 2 8 4 ) ĊĊĠĠĠĠĠĠĠ Ġgiven ( interactive Q Service . getHost Info ( any String (), Ġany String (), Ġany < String Serializer > ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. willReturn ( host Info ) ĊĊĠĠĠĠĠĠĠ Ġgiven ( web client Utils . do Get ( host Info , Ġ"/ rpc / command - response / 1 ", ĠCommand Response :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. willReturn ( Mono . just ( c Response )) ĊĊĠĠĠĠĠĠĠ ĠStep Verifier . create ( command Response Repo . find Command Response ( c Response . get Command Id ())) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. expect Next ( c Response ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. verify Complete () ĊĊĠĠĠ Ġ} Ċ } Ċ