package Ġcom . github . vh rom ada . catalog . facade Ċ Ċ import Ġcom . github . vh rom ada . catalog . Test Configuration Ċ import Ġcom . github . vh rom ada . catalog . utils . Audit Utils Ċ import Ġcom . github . vh rom ada . catalog . utils . Che at Data Utils Ċ import Ġcom . github . vh rom ada . catalog . utils . Che at Utils Ċ import Ġcom . github . vh rom ada . catalog . utils . Game Utils Ċ import Ġcom . github . vh rom ada . catalog . utils . Test Constants Ċ import Ġcom . github . vh rom ada . catalog . utils . fill Audit Ċ import Ġcom . github . vh rom ada . catalog . utils . updated Ċ import Ġcom . github . vh rom ada . common . exception . Input Exception Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . assertj . core . api . Assertions . assertThat Thrown By Ċ import Ġorg . assertj . core . api . Soft Assertions . assert Soft ly Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . extension . Extend With Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . http . HttpStatus Ċ import Ġorg . springframework . test . annotation . Dir ties Context Ċ import Ġorg . springframework . test . annotation . Rollback Ċ import Ġorg . springframework . test . context . Context Configuration Ċ import Ġorg . springframework . test . context . junit . jupiter . Spring Extension Ċ import Ġorg . springframework . transaction . annotation . Transactional Ċ import Ġjavax . persistence . EntityManager Ċ import Ġjavax . persistence . Persistence Context Ċ Ċ /** Ċ Ġ* ĠA Ġclass Ġrepresents Ġtest Ġfor Ġclass Ġ[ Che at Facade ]. Ċ Ġ* Ċ Ġ* Ġ@ author ĠV lad im ir ĠH rom ada Ċ Ġ*/ Ċ @ Extend With ( Spring Extension :: class ) Ċ @ Context Configuration ( classes Ġ= Ġ[ Test Configuration :: class ]) Ċ @ Transactional Ċ @ Rollback Ċ class ĠChe at Facade Spring Test Ġ{ ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠInstance Ġof Ġ[ EntityManager ] ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Persistence Context ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġentity Manager : ĠEntity Manager ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠInstance Ġof Ġ[ Che at Facade ] ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġfac ade : ĠChe at Facade ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . find ]. ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfind () Ġ{ ĊĠĠĠĠĠĠĠ Ġfor Ġ( i Ġin Ġ 2 .. Game Utils . G AMES _ COUNT ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġgame Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġi ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġfac ade . find ( game Ġ= Ġgame . uuid ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠChe at Utils . assert Che at Deep Equals ( expected Ġ= ĠChe at Utils . get Domain Che at ( index Ġ= Ġi Ġ- Ġ 1 ), Ġactual Ġ= Ġresult ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . find ] Ġwith Ġnot Ġexisting Ġgame . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfind Not Existing Game () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . find ( game Ġ= ĠTest Constants . UUID ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" GAME _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Game Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . find ] Ġwith Ġnot Ġexisting ĠUUID . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġfind Not Existing () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . find ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ). uuid ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . get ]. ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget () Ġ{ ĊĠĠĠĠĠĠĠ Ġfor Ġ( i Ġin Ġ 2 .. Game Utils . G AMES _ COUNT ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġgame Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġi ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġfac ade . get ( game Ġ= Ġgame . uuid , Ġuuid Ġ= Ġgame . che at !!. uuid ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠChe at Utils . assert Che at Deep Equals ( expected Ġ= Ġgame . che at !! , Ġactual Ġ= Ġresult ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . get ] Ġwith Ġnot Ġexisting Ġgame . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Not Existing Game () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . get ( game Ġ= ĠTest Constants . UUID , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" GAME _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Game Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . get ] Ġwith Ġnot Ġexisting ĠUUID . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġget Not Existing () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . get ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠTest Constants . UUID ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ]. ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Dir ties Context ĊĠĠĠ Ġfun Ġadd () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġgame Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. fill Audit ( audit Ġ= ĠAudit Utils . updated Audit ()) ĊĠĠĠĠĠĠĠ Ġval Ġexpected Che at Ġ= ĠChe at Utils . new Che at () ĊĠĠĠĠĠĠĠ Ġval Ġexpected Domain Che at Ġ= ĠChe at Utils . new Domain Che at ( id Ġ= ĠChe at Utils . CHE ATS _ COUNT Ġ+ Ġ 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= Ġmutable ListOf ( Che at Data Utils . new Domain Che at Data ( id Ġ= ĠChe at Data Utils . CHE AT _ DATA _ COUNT Ġ+ Ġ 1 ). fill Audit ( audit Ġ= ĠAudit Utils . new Audit ()))) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. fill Audit ( audit Ġ= ĠAudit Utils . new Audit ()) ĊĠĠĠĠĠĠĠ Ġexpected Domain Che at . game Ġ= Ġgame ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġfac ade . add ( game Ġ= Ġgame . uuid , Ġrequest Ġ= ĠChe at Utils . new Request ()) ĊĠĠĠĠĠĠĠ Ġentity Manager . flush () ĊĊĠĠĠĠĠĠĠ ĠChe at Utils . assert Che at Deep Equals ( expected Ġ= Ġexpected Che at , Ġactual Ġ= Ġresult ) ĊĠĠĠĠĠĠĠ ĠChe at Utils . assert Che at Deep Equals ( expected Ġ= Ġexpected Domain Che at , Ġactual Ġ= ĠChe at Utils . get Domain Che at ( entityManager Ġ= Ġentity Manager , Ġid Ġ= ĠChe at Utils . CHE ATS _ COUNT Ġ+ Ġ 1 )) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT Ġ+ Ġ 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT Ġ+ Ġ 1 ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġrequest Ġwith Ġnull Ġche at 's Ġdata . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Null Che at Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= Ġnull ) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ). uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġmust n 't Ġbe Ġnull .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġnull Ġvalue . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Bad Che at Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( null )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ). uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ CONTAIN _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġmust n 't Ġcontain Ġnull Ġvalue .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġnull Ġaction . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Che at Data With Null Action () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( action Ġ= Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ). uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ ACTION _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġaction Ġmust n 't Ġbe Ġnull .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġempty Ġaction . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Che at Data With Empty Action () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( action Ġ= Ġ"") ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ). uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ ACTION _ EMPTY ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġaction Ġmust n 't Ġbe Ġempty Ġstring .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġnull Ġdescription . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Che at Data With Null Description () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( description Ġ= Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ). uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ DESCRIPTION _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġdescription Ġmust n 't Ġbe Ġnull .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġempty Ġdescription . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Che at Data With Empty Description () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( description Ġ= Ġ"") ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 1 ). uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ DESCRIPTION _ EMPTY ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġdescription Ġmust n 't Ġbe Ġempty Ġstring .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġexisting Ġche at . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Existing Che at () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġrequest Ġ= ĠChe at Utils . new Request ()) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at Ġalready Ġexists .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . add ] Ġwith Ġnot Ġexisting Ġgame . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġadd Not Existing Game () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . add ( game Ġ= ĠTest Constants . UUID , Ġrequest Ġ= ĠChe at Utils . new Request ()) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" GAME _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Game Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ]. ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Dir ties Context ĊĠĠĠ Ġfun Ġupdate () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġgame Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠ Ġval Ġexpected Che at Ġ= ĠChe at Utils . get Che at ( index Ġ= Ġ 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( Che at Data Utils . new Che at Data ())) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. updated () ĊĠĠĠĠĠĠĠ Ġval Ġexpected Domain Che at Ġ= Ġgame . che at !! ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. updated () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. fill Audit ( audit Ġ= ĠAudit Utils . updated Audit ()) ĊĠĠĠĠĠĠĠ Ġexpected Domain Che at . data . clear () ĊĠĠĠĠĠĠĠ Ġexpected Domain Che at . data . add ( Game Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. data . first (). updated (). fill Audit ( audit Ġ= ĠAudit Utils . updated Audit ())) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult Ġ= Ġfac ade . update ( game Ġ= Ġgame . uuid , Ġuuid Ġ= Ġgame . che at !!. uuid , Ġrequest Ġ= Ġrequest ) ĊĠĠĠĠĠĠĠ Ġentity Manager . flush () ĊĊĠĠĠĠĠĠĠ ĠChe at Utils . assert Che at Deep Equals ( expected Ġ= Ġexpected Che at , Ġactual Ġ= Ġresult ) ĊĠĠĠĠĠĠĠ ĠChe at Utils . assert Che at Deep Equals ( expected Ġ= Ġexpected Domain Che at , Ġactual Ġ= ĠChe at Utils . get Domain Che at ( entityManager Ġ= Ġentity Manager , Ġid Ġ= Ġ 1 )) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT Ġ- ĠChe at Data Utils . CHE AT _ DATA _ CHE AT _ COUNT Ġ+ Ġ 1 ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġrequest Ġwith Ġnull Ġche at 's Ġdata . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Null Che at Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= Ġnull ) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġmust n 't Ġbe Ġnull .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġnull Ġvalue . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Bad Che at Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( null )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ CONTAIN _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġmust n 't Ġcontain Ġnull Ġvalue .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġnull Ġaction . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Che at Data With Null Action () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( action Ġ= Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ ACTION _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġaction Ġmust n 't Ġbe Ġnull .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġempty Ġaction . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Che at Data With Empty Action () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( action Ġ= Ġ"") ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ ACTION _ EMPTY ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġaction Ġmust n 't Ġbe Ġempty Ġstring .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġnull Ġdescription . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Che at Data With Null Description () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( description Ġ= Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ DESCRIPTION _ NULL ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġdescription Ġmust n 't Ġbe Ġnull .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġrequest Ġwith Ġche at 's Ġdata Ġwith Ġempty Ġdescription . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Che at Data With Empty Description () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġche at Data Ġ= ĠChe at Data Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( description Ġ= Ġ"") ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠChe at Utils . new Request () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. copy ( data Ġ= ĠlistOf ( che at Data )) ĊĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid , Ġrequest Ġ= Ġrequest ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ DATA _ DESCRIPTION _ EMPTY ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at 's Ġdata Ġdescription Ġmust n 't Ġbe Ġempty Ġstring .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . UN PROCESS ABLE _ ENTITY ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġnot Ġexisting Ġgame . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Not Existing Game () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠTest Constants . UUID , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid , Ġrequest Ġ= ĠChe at Utils . new Request ()) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" GAME _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Game Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . update ] Ġwith Ġnot Ġexisting ĠUUID . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġupdate Not Existing () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . update ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠTest Constants . UUID , Ġrequest Ġ= ĠChe at Utils . new Request ()) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . remove ]. ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġremove () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġgame Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ) ĊĊĠĠĠĠĠĠĠ Ġfac ade . remove ( game Ġ= Ġgame . uuid , Ġuuid Ġ= Ġgame . che at !!. uuid ) ĊĠĠĠĠĠĠĠ Ġentity Manager . flush () ĊĊĠĠĠĠĠĠĠ ĠassertThat ( Che at Utils . get Domain Che at ( entityManager Ġ= Ġentity Manager , Ġid Ġ= Ġ 1 )). isNull () ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT Ġ- Ġ 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT Ġ- ĠChe at Data Utils . CHE AT _ DATA _ CHE AT _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . remove ] Ġwith Ġnot Ġexisting Ġgame . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġremove Not Existing Game () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . remove ( game Ġ= ĠTest Constants . UUID , Ġuuid Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). che at !!. uuid ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" GAME _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Game Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠTest Ġmethod Ġfor Ġ[ Che at Facade . remove ] Ġwith Ġnot Ġexisting ĠUUID . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġremove Not Existing () Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat Thrown By Ġ{ Ġfac ade . remove ( game Ġ= ĠGame Utils . get Domain Game ( index Ġ= Ġ 2 ). uuid , Ġuuid Ġ= ĠTest Constants . UUID ) Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. isInstanceOf ( Input Exception :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" CHE AT _ NOT _ EXIST ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Message Containing (" Che at Ġdoesn 't Ġexist .") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. has Field Or Property WithValue (" http Status ", ĠHttpStatus . NOT _ FOUND ) ĊĊĠĠĠĠĠĠĠ Ġassert Soft ly Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Utils . get Che ats Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Utils . CHE ATS _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Game Utils . get Games Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Game Utils . G AMES _ COUNT ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . assertThat ( Che at Data Utils . get Che at Data Count ( entityManager Ġ= Ġentity Manager )). isEqualTo ( Che at Data Utils . CHE AT _ DATA _ COUNT ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ } Ċ