package Ġca . software add . domain . resolvers Ċ Ċ import Ġca . software add . country . Country Ċ import Ġca . software add . country . Create Country Command Ċ import Ġca . software add . domain . events . Event Entity Ċ import Ġorg . junit . jupiter . api . Assertions .* Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . extension . Extend With Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . test . context . Context Configuration Ċ import Ġorg . springframework . test . context . junit . jupiter . Spring Extension Ċ import Ġjava . util .* Ċ Ċ private Ġconst Ġval ĠCREATE _ COUNTRY _ COMMAND Ġ= Ġ" create - country " Ċ Ċ @ Extend With ( Spring Extension :: class ) Ċ @ Context Configuration ( classes Ġ= Ġ[ ĊĠĠĠ ĠCommand Handler Resolver :: class , ĊĠĠĠ ĠCommand Type Resolver :: class Ċ ]) Ċ internal Ġclass ĠCommand Handler Resolver Test Ġ{ ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġresolver : ĠCommand Handler Resolver ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` resolver Ġshould Ġreturn Ġmethod Ġannotated Ġwith ĠCommand Handler `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhandler Ġ= Ġresolver . find Handler ( Country :: class , ĠCREATE _ COUNTRY _ COMMAND ) ĊĠĠĠĠĠĠĠ ĠassertNotNull ( handler ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġhandler ?. parameters ?. size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Country :: class , Ġhandler ?. parameters ?. get ( 0 )?. type ?. classifier ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Create Country Command :: class , Ġhandler ?. parameters ?. get ( 1 )?. type ?. classifier ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` resolver Ġshould Ġreturn Ġnull Ġif Ġtype Ġis Ġnot Ġfound `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhandler Ġ= Ġresolver . find Handler ( Country :: class , ĠUUID . randomUUID (). toString ()) ĊĠĠĠĠĠĠĠ ĠassertNull ( handler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġinternal Ġfun Ġ` resolver Ġshould Ġreturn Ġnull Ġif Ġno Ġannotated Ġhandlers `() Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġhandler Ġ= Ġresolver . find Handler ( Event Entity :: class , ĠCREATE _ COUNTRY _ COMMAND ) ĊĠĠĠĠĠĠĠ ĠassertNull ( handler ) ĊĠĠĠ Ġ} Ċ } Ċ