package Ġorg . k ent unc . bit tr ader . order . api . application Ċ Ċ import Ġcom . nin jas quad . spring mock k . Mock k Bean Ċ import Ġio . mock k . co Every Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . junit . jupiter . api . Assertions . assertEquals Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . k ent unc . bit tr ader . common . domain . model . market . Com mission Rate Ċ import Ġorg . k ent unc . bit tr ader . common . domain . model . market . Product Code Ċ import Ġorg . k ent unc . bit tr ader . order . api . domain . service . Com mission Rate Service Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . test . context . junit . jupiter . Spring JUnit Config Ċ Ċ @ Spring JUnit Config ( Com mission Rate Interactor :: class ) Ċ internal Ġclass ĠCom mission Rate Interactor Test Ġ{ ĊĊĠĠĠ Ġ@ Mock k Bean ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġcom mission Rate Service : ĠCom mission Rate Service ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġtarget : ĠCom mission Rate Interactor ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun ĠtestGet By Product Code () Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġsetup : ĊĠĠĠĠĠĠĠ Ġval Ġproduct Code Ġ= ĠProduct Code . BTC _ J PY ĊĠĠĠĠĠĠĠ Ġval Ġcom mission Rate Ġ= ĠCom mission Rate . of ( 0 . 0 0 1 5 ) ĊĠĠĠĠĠĠĠ Ġco Every Ġ{ Ġcom mission Rate Service . get ( product Code ) Ġ} Ġreturns Ġcom mission Rate ĊĊĠĠĠĠĠĠĠ Ġ// Ġexercise : ĊĠĠĠĠĠĠĠ Ġval Ġactual Ġ= Ġtarget . getBy Product Code ( product Code ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġverify : ĊĠĠĠĠĠĠĠ ĠassertEquals ( commission Rate , Ġactual ) ĊĠĠĠ Ġ} Ċ } Ċ