package Ġno . dig dir . catalog _ comments _ service . unit Ċ Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . mock Ċ import Ġcom . n ha ar man . mock it ok otlin 2 . wh enever Ċ import Ġno . dig dir . catalog _ comments _ service . repository . Comment DAO Ċ import Ġno . dig dir . catalog _ comments _ service . repository . User DAO Ċ import Ġno . dig dir . catalog _ comments _ service . service . Comment Service Ċ import Ġno . dig dir . catalog _ comments _ service . service . to DB O Ċ import Ġno . dig dir . catalog _ comments _ service . utils . Api TestContext Ċ import Ġno . dig dir . catalog _ comments _ service . utils . COMMENT _ 0 Ċ import Ġno . dig dir . catalog _ comments _ service . utils . COMMENT _ 1 Ċ import Ġorg . junit . jupiter . api . Tag Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġkotlin . test . assertTrue Ċ Ċ @ Tag (" unit ") Ċ class ĠComment Service : ĠApi TestContext () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġcomment DAO : ĠComment DAO Ġ= Ġmock () ĊĠĠĠ Ġprivate Ġval Ġuser DAO : ĠUser DAO Ġ= Ġmock () ĊĠĠĠ Ġprivate Ġval Ġcomment Service Ġ= ĠComment Service ( comment DAO , Ġuser DAO ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Get Ġall Ġcomments Ġby Ġtopic Ġid ` Ġ() Ġ{ ĊĠĠĠĠĠĠĠ Ġwhenever ( comment DAO . find Comments By Org Number And Topic Id (" 2 4 6 8 1 3 5 7 9 "," topic Id 0 ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. thenReturn ( listOf ( COMMENT _ 0 , ĠCOMMENT _ 1 ). map Ġ{ Ġit . to DB O (" 2 4 6 8 1 3 5 7 9 "," topic Id 0 "," 1 9 2 4 7 8 2 5 6 3 ") Ġ}) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġcomment Service . get Comments By Org Number And Topic Id (" 2 4 6 8 1 3 5 7 9 ", Ġ" topic Id 0 ") ĊĊĠĠĠĠĠĠĠ ĠassertTrue Ġ{ Ġresult . size Ġ== Ġ 2 Ġ} ĊĠĠĠ Ġ} Ċ } Ċ