package Ġutils Ċ Ċ import Ġdomain . Fight Ċ import Ġdomain . Fight er Ċ import Ġio . mock k . every Ċ import Ġio . mock k . mock k Object Ċ import Ġorg . junit . Assert . assertEquals Ċ import Ġorg . junit . Assert . assertNotNull Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . jupiter . api . assert Throws Ċ Ċ class ĠResponse Generator Test Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġfavorite Fight er Ġ= ĠF ight er (" Favorite ĠName ") ĊĠĠĠ Ġprivate Ġval Ġunder dog Fight er Ġ= ĠF ight er (" Under dog ĠName ") ĊĠĠĠ Ġprivate Ġval Ġfavorite O dds Ġ= Ġ 1 . 5 ĊĠĠĠ Ġprivate Ġval Ġunder dog O dds Ġ= Ġ 2 . 5 ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Response Generator _ Valid Fight () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġexpected Response Ġ= Ġ" The Ġodd s ĠF avorite ĠName Ġwins Ġis Ġ- 2 0 0 Ġand Ġthe Ġodd s ĠUnder dog ĠName Ġwins Ġis Ġ+ 1 5 0 " ĊĠĠĠĠĠĠĠ Ġval Ġmocked Fight Ġ= ĠF ight ( favorite Fight er , Ġunder dog Fight er , Ġfavorite O dds , Ġunder dog O dds ) ĊĠĠĠĠĠĠĠ Ġval Ġmock Fight List Ġ= ĠlistOf ( mocked Fight ) ĊĠĠĠĠĠĠĠ Ġmock k Object ( Fight Matcher ) ĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĠF ight Matcher . find Matching Fight ( mock Fight List , Ġfavorite Fight er . name ) Ġ} Ġreturns Ġmocked Fight ĊĊĠĠĠĠĠĠĠ Ġval Ġactual Response Ġ= ĠResponse Generator . generate Response ( favorite Fight er . name , Ġmock Fight List ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( expected Response , Ġactual Response ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Response Generator _ Fight Has No O dds Favorite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmocked Invalid Fight Ġ= ĠF ight ( favorite Fight er , Ġunder dog Fight er , Ġnull , Ġ 2 . 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġmock Fight List Ġ= ĠlistOf ( mocked Invalid Fight ) ĊĠĠĠĠĠĠĠ Ġmock k Object ( Fight Matcher ) ĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĠF ight Matcher . find Matching Fight ( mock Fight List , Ġfavorite Fight er . name ) Ġ} Ġreturns Ġmocked Invalid Fight ĊĊĠĠĠĠĠĠĠ ĠassertThrows < Exception > Ġ{ ĠResponse Generator . generate Response ( favorite Fight er . name , Ġmock Fight List ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Response Generator _ Fight Has No O dds Under go () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmocked Invalid Fight Ġ= ĠF ight ( favorite Fight er , Ġunder dog Fight er , Ġ 1 . 0 , Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġmock Fight List Ġ= ĠlistOf ( mocked Invalid Fight ) ĊĠĠĠĠĠĠĠ Ġmock k Object ( Fight Matcher ) ĊĠĠĠĠĠĠĠ Ġevery Ġ{ ĠF ight Matcher . find Matching Fight ( mock Fight List , Ġfavorite Fight er . name ) Ġ} Ġreturns Ġmocked Invalid Fight ĊĊĠĠĠĠĠĠĠ ĠassertThrows < Exception > Ġ{ ĠResponse Generator . generate Response ( favorite Fight er . name , Ġmock Fight List ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Constructor () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġresponse Generator Ġ= ĠResponse Generator () ĊĊĠĠĠĠĠĠĠ ĠassertNotNull ( response Generator ) ĊĠĠĠ Ġ} Ċ Ċ }