package Ġcom . so yle . stories . use case . character . name Variant Ċ Ċ import Ġcom . so yle . stories . domain . character .* Ċ import Ġcom . so yle . stories . domain . character . events . Character Name Variant Removed Ċ import Ġcom . so yle . stories . domain . character . events . Character Name Variant Rename d Ċ import Ġcom . so yle . stories . domain . must Equal Ċ import Ġcom . so yle . stories . domain . validation . Non Blank String Ċ import Ġcom . so yle . stories . use case . character . Character DoesNotExist Ċ import Ġcom . so yle . stories . use case . character . name Variant . remove . Remove Character Name Variant Ċ import Ġcom . so yle . stories . use case . character . name Variant . remove . Remove Character Name Variant UseCase Ċ import Ġcom . so yle . stories . use case . repositories . Character Repository Double Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . junit . jupiter . api .* Ċ import Ġorg . junit . jupiter . api . Assertions . assertNull Ċ Ċ class Ġ` Remove ĠCharacter ĠName ĠVariant ĠUnit ĠTest ` Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcharacter Ġ= Ġmake Character () ĊĠĠĠ Ġprivate Ġval Ġvariant Ġ= Ġcharacter Name () ĊĊĠĠĠ Ġprivate Ġvar Ġupdated Character : ĠCharacter ? Ġ= Ġnull ĊĊĠĠĠ Ġprivate Ġval Ġcharacter Repository Ġ= ĠCharacter Repository Double ( on Update Character Ġ= Ġ:: updated Character :: set ) ĊĊĠĠĠ Ġprivate Ġvar Ġresult : ĠRemove Character Name Variant . Response Model ? Ġ= Ġnull ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` character Ġdoesn 't Ġexist Ġ- Ġshould Ġthrow Ġerror `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġerror Ġ= ĠassertThrows < Character DoesNotExist > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġremove Character Name Variant () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġerror . character Id . must Equal ( character . id . uuid ) ĊĠĠĠĠĠĠĠ ĠassertNull ( result ) ĊĠĠĠĠĠĠĠ ĠassertNull ( updated Character ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` character Ġdoesn 't Ġhave Ġrequested Ġname Ġvariant Ġ- Ġshould Ġthrow Ġerror `() Ġ{ ĊĠĠĠĠĠĠĠ Ġcharacter Repository . given Character ( character ) ĊĠĠĠĠĠĠĠ Ġval Ġerror Ġ= ĠassertThrows < Character DoesNot Have Name Variant > Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġremove Character Name Variant () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġerror . must Equal ( Character DoesNot Have Name Variant ( character . id , Ġvariant . value )) ĊĠĠĠĠĠĠĠ ĠassertNull ( result ) ĊĠĠĠĠĠĠĠ ĠassertNull ( updated Character ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Nested ĊĠĠĠ Ġinner Ġclass Ġ` Given ĠRem oval Ġis ĠSuccessful ` Ġ{ ĊĊĠĠĠĠĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcharacter Repository . given Character ( character . with Name Variant ( variant ). character ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġ@ Test ĊĠĠĠĠĠĠĠ Ġfun Ġ` should Ġupdate Ġcharacter `() Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġremove Character Name Variant () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġupdated Character !!. other Names . contains ( variant ). must Equal ( false ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġ@ Test ĊĠĠĠĠĠĠĠ Ġfun Ġ` should Ġoutput Ġremoved Ġvariant Ġevent `() Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġremove Character Name Variant () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresult !!. character Name Variant Removed ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. must Equal ( Character Name Variant Removed ( character . id , Ġvariant )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġ@ Test ĊĠĠĠĠĠĠĠ Ġfun Ġ` should Ġnot Ġreturn Ġa Ġfailure Ġmessage `() Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfailure Ġ= Ġremove Character Name Variant () ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssertions . assertNull ( failure ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġremove Character Name Variant ( variant : ĠNon Blank String Ġ= Ġthis . variant ): ĠCharacter Exception ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġuse Case : ĠRemove Character Name Variant Ġ= ĠRemove Character Name Variant UseCase ( character Repository ) ĊĠĠĠĠĠĠĠ Ġreturn Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġuse Case . invoke ( character . id , Ġvariant ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresult Ġ= Ġit ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ }