package Ġuk . gov . just ice . digital . h mp ps . where about s . services Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . assertj . core . api . Assertions . assertThat Thrown By Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġuk . gov . just ice . digital . h mp ps . where about s . model . Absent Reason Ċ Ċ class ĠNom is Event Outcome Mapper Test Ġ{ ĊĠ Ġprivate Ġval Ġevent Outcome Mapper Ġ= ĠNom is Event Outcome Mapper () ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġthrow Ġan Ġexception Ġwhen Ġa Ġun paid Ġreason Ġis Ġused Ġfor Ġa Ġpaid Ġatt endance `() Ġ{ ĊĠĠĠ Ġval Ġun paid Re asons Ġ= ĠAbs ent Reason . un paid Re asons ĊĊĠĠĠ Ġun paid Re asons . forEach Ġ{ ĊĠĠĠĠĠ Ġval Ġreason Ġ= Ġit ĊĊĠĠĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠĠĠ Ġevent Outcome Mapper . getEvent Outcome ( reason , Ġat tended Ġ= Ġfalse , Ġpaid Ġ= Ġtrue , Ġcomment Ġ= Ġnull ) ĊĠĠĠĠĠ Ġ}. has Message ( String . format ("% s Ġis Ġnot Ġa Ġvalid Ġpaid Ġreason ", Ġreason )) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġthrow Ġan Ġexception Ġwhen Ġa Ġpaid Ġreason Ġis Ġused Ġfor Ġan Ġun paid Ġatt endance `() Ġ{ ĊĊĠĠĠ Ġval Ġun paid Re asons Ġ= ĠAbs ent Reason . paid Re asons ĊĊĠĠĠ Ġun paid Re asons . forEach Ġ{ ĊĠĠĠĠĠ Ġval Ġreason Ġ= Ġit ĊĊĠĠĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠĠĠ Ġevent Outcome Mapper . getEvent Outcome ( reason , Ġat tended Ġ= Ġfalse , Ġpaid Ġ= Ġfalse , Ġcomment Ġ= Ġnull ) ĊĠĠĠĠĠ Ġ}. has Message ( String . format ("% s Ġis Ġnot Ġa Ġvalid Ġun paid Ġreason ", Ġreason )) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġthrow Ġan Ġexception Ġwhen Ġan Ġabsent Ġreason Ġis Ġsupplied Ġfor Ġa Ġa Ġvalid Ġatt endance `() Ġ{ ĊĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠ Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Session Cancelled , Ġat tended Ġ= Ġtrue , Ġpaid Ġ= Ġtrue , Ġcomment Ġ= Ġnull ) ĊĠĠĠ Ġ}. has Message (" An Ġabsent Ġreason Ġwas Ġsupplied Ġfor Ġa Ġvalid Ġatt endance ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġmake Ġabsent Ġreason Ġrequired ' Ġwhen Ġatt endance Ġis Ġnot Ġset `() Ġ{ ĊĠĠĠ ĠassertThat Thrown By Ġ{ ĊĠĠĠĠĠ Ġevent Outcome Mapper . getEvent Outcome ( null , Ġfalse , Ġpaid Ġ= Ġtrue , Ġcomment Ġ= Ġnull ) ĊĠĠĠ Ġ}. has Message (" An Ġabsent Ġreason Ġwas Ġnot Ġsupplied ") ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' ATT ' Ġand Ġ' STANDARD ' Ġoutcome `() Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( null , Ġtrue , Ġtrue , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" ATT ", Ġ" STANDARD ", Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' ACC AB ' Ġfor Ġ' Accept able Abs ence '` () Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Accept able Abs ence , Ġfalse , Ġtrue , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" ACC AB ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' N REQ ' Ġfor Ġ' Not Required '` () Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Not Required , Ġfalse , Ġtrue , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" N REQ ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' CAN C ' Ġfor Ġ' Session Cancelled '` () Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Session Cancelled , Ġfalse , Ġfalse , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" CAN C ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' REST ' Ġfor Ġ' Rest In Cell Or S ick `() Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Rest In Cell Or S ick , Ġfalse , Ġfalse , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" REST ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' REST ' Ġfor Ġ' Rest Day '` () Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Rest Day , Ġfalse , Ġfalse , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" REST ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' UN AC AB ' Ġfor Ġ' Ref used '` () Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Ref used , Ġfalse , Ġfalse , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" UN AC AB ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' UN AC AB ' Ġfor Ġ' Un accept able Abs ence '` () Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Un accept able Abs ence , Ġfalse , Ġfalse , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" UN AC AB ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' ACC AB ' Ġfor Ġ' Approved Course '` () Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Approved Course , Ġfalse , Ġtrue , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" ACC AB ", Ġnull , Ġ" hello ")) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` should Ġreturn Ġ' UN AC AB ' Ġfor Ġ Ġ' Ref used In cent ive Level Warning `() Ġ{ ĊĠĠĠ Ġval Ġnom is Outcome Ġ= ĊĠĠĠĠĠ Ġevent Outcome Mapper . getEvent Outcome ( Absent Reason . Ref used In cent ive Level Warning , Ġfalse , Ġfalse , Ġ" hello ") ĊĊĠĠĠ ĠassertThat ( nom is Outcome ). isEqualTo ( Event Outcome (" UN AC AB ", Ġnull , Ġ" hello ")) ĊĠ Ġ} Ċ } Ċ