package Ġcom . we ed ow . search y . exception Ċ Ċ import Ġcom . we ed ow . search y . validation . Search y Error Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . http . HttpStatus Ċ Ċ internal Ġclass ĠValidation Exception Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest _ with _ default _ arguments () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġerror 1 Ġ= ĠSearch y Error (" 4 0 0 1 ", Ġ" This Ġis Ġthe Ġfirst Ġerror ") ĊĠĠĠĠĠĠĠ Ġval Ġerror 2 Ġ= ĠSearch y Error (" 4 0 0 2 ", Ġ" This Ġis Ġthe Ġsecond Ġerror ") ĊĊĠĠĠĠĠĠĠ Ġval Ġvalidation Exception Ġ= ĠValidation Exception ( listOf ( error 1 , Ġerror 2 )) ĊĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . errors ). contains Exactly ( error 1 , Ġerror 2 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . status ). isEqualTo ( HttpStatus . BAD _ REQUEST ) ĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . reason ). isEqualTo (" Validation ĠErrors : Ġ[ ${ error 1 . errorCode }: Ġ${ error 1 . errorMessage }, Ġ${ error 2 . errorCode }: Ġ${ error 2 . errorMessage }] ") ĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . message ). isEqualTo ("${ HttpStatus . BAD _ REQUEST } Ġ\" Validation ĠErrors : Ġ[ ${ error 1 . errorCode }: Ġ${ error 1 . errorMessage }, Ġ${ error 2 . errorCode }: Ġ${ error 2 . errorMessage }] \" ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest _ with _ custom _ arguments () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġerror 1 Ġ= ĠSearch y Error (" 5 0 0 1 ", Ġ" This Ġis Ġthe Ġfirst Ġerror ") ĊĠĠĠĠĠĠĠ Ġval Ġerror 2 Ġ= ĠSearch y Error (" 5 0 0 2 ", Ġ" This Ġis Ġthe Ġsecond Ġerror ") ĊĊĠĠĠĠĠĠĠ Ġval Ġvalidation Exception Ġ= ĠValidation Exception ( listOf ( error 1 , Ġerror 2 ), ĠHttpStatus . INTERNAL _ SERVER _ ERROR , Ġ" Custom ĠReason ") ĊĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . errors ). contains Exactly ( error 1 , Ġerror 2 ) ĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . status ). isEqualTo ( HttpStatus . INTERNAL _ SERVER _ ERROR ) ĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . reason ). isEqualTo (" Custom ĠReason ") ĊĠĠĠĠĠĠĠ ĠassertThat ( validation Exception . message ). isEqualTo ("${ HttpStatus . INTERNAL _ SERVER _ ERROR } Ġ\" Custom ĠReason \" ") ĊĠĠĠ Ġ} Ċ }