package Ġcom . l sd consult ing . exception handling . server . filter Ċ Ċ import Ġcom . l sd consult ing . exception handling . server . time . Default Time Provider Configuration Ċ import Ġorg . hamcrest . Matcher Assert . assertThat Ċ import Ġorg . hamcrest . Matchers .` is ` Ċ import Ġorg . hamcrest . Matchers . notNull Value Ċ import Ġorg . hamcrest . collection . Is Map Containing . has Key Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . boot . autoconfigure . web . servlet . Servlet WebServer Factory Auto Configuration Ċ import Ġorg . springframework . boot . test . util . Test Property Values Ċ import Ġorg . springframework . boot . web . servlet . context . Annotation Config Servlet WebServer ApplicationContext Ċ Ċ internal Ġclass ĠRequest Filter Configuration Should Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġregister Request StartTime Filter () Ġ{ ĊĠĠĠĠĠĠĠ ĠAnnotation Config Servlet WebServer ApplicationContext (). use Ġ{ Ġcontext Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠTest Property Values . of (" server . port = 0 "). apply To ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext . register ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠDefault Time Provider Configuration :: class . java , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠServlet WebServer Factory Auto Configuration :: class . java , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠRequest Filter Configuration :: class . java ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext . refresh () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġservlet Context Ġ= Ġcontext . servlet Context !! ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( servlet Context , Ġnot NullValue ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfilter Regist rations Ġ= Ġservlet Context . filter Regist rations ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( filter Regist rations , Ġhas Key (" request StartTime Filter ")) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠassertThat ( filter Regist rations [" request StartTime Filter "] !!. className , Ġ` is `( Request StartTime Filter :: class . java . name )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ