package Ġcom . fire fly source . net . http . server . impl . matcher Ċ Ċ import Ġcom . fire fly source . net . http . common . model . HttpMethod Ċ import Ġcom . fire fly source . net . http . server . Matcher Ċ import Ġcom . fire fly source . net . http . server . impl . router . Async Router Ċ import Ġcom . fire fly source . net . http . server . impl . router . Async Router Manager Ċ import Ġorg . junit . jupiter . api . Assertions . assertEquals Ċ import Ġorg . junit . jupiter . api . DisplayName Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . mockito . Mockito Ċ Ċ class ĠTest HttpMethod Matcher Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġrouter Manager Ġ= ĠMockito . mock ( Async Router Manager :: class . java ) ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ DisplayName (" should Ġmatch Ġrouter Ġby Ġthe Ġhttp Ġmethod Ġsuccessfully .") ĊĠĠĠ Ġfun Ġtest () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmatcher Ġ= ĠHttpMethod Matcher () ĊĠĠĠĠĠĠĠ Ġval Ġrouter 1 Ġ= ĠAsync Router ( 1 , Ġrouter Manager ) ĊĠĠĠĠĠĠĠ Ġval Ġrouter 2 Ġ= ĠAsync Router ( 2 , Ġrouter Manager ) ĊĠĠĠĠĠĠĠ Ġval Ġrouter 3 Ġ= ĠAsync Router ( 3 , Ġrouter Manager ) ĊĠĠĠĠĠĠĠ Ġmatcher . add ( HttpMethod . GET . value , Ġrouter 1 ) ĊĠĠĠĠĠĠĠ Ġmatcher . add (" get ", Ġrouter 2 ) ĊĠĠĠĠĠĠĠ Ġmatcher . add (" POST ", Ġrouter 3 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult 1 Ġ= Ġmatcher . match (" GET ") ĊĠĠĠĠĠĠĠ Ġrequire NotNull ( result 1 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġresult 1 . rout ers . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Matcher . Match Type . METHOD , Ġresult 1 . match Type ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult 2 Ġ= Ġmatcher . match (" get ") ĊĠĠĠĠĠĠĠ Ġrequire NotNull ( result 2 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 2 , Ġresult 2 . rout ers . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Matcher . Match Type . METHOD , Ġresult 2 . match Type ) ĊĊĠĠĠĠĠĠĠ Ġval Ġresult 3 Ġ= Ġmatcher . match (" POST ") ĊĠĠĠĠĠĠĠ Ġrequire NotNull ( result 3 ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġresult 3 . rout ers . size ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( Matcher . Match Type . METHOD , Ġresult 3 . match Type ) ĊĠĠĠ Ġ} Ċ }