File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,8 @@ impl AppExt for App {
218218#[ cfg( test) ]
219219mod test {
220220 use super :: * ;
221- use crate :: app:: test:: TestApp ;
221+ pub ( super ) use crate :: app:: test:: * ;
222+ use shared:: conn:: msg_dispatch:: test:: TestRequest ;
222223
223224 impl AppExt for TestApp {
224225 fn fail_on_pre_shutdown ( & self ) -> Result < ( ) > {
@@ -229,4 +230,20 @@ mod test {
229230 }
230231 }
231232 }
233+
234+ pub ( super ) async fn test_handler_resp < M : Msg + HandleWithResponse > (
235+ msg : M ,
236+ app : & impl AppExt ,
237+ ) -> Result < M :: Response > {
238+ let mut req = TestRequest :: new ( M :: ID ) ;
239+ msg. handle ( app, & mut req) . await
240+ }
241+
242+ pub ( super ) async fn test_handler_no_resp < M : Msg + HandleNoResponse > (
243+ msg : M ,
244+ app : & impl AppExt ,
245+ ) -> Result < ( ) > {
246+ let mut req = TestRequest :: new ( M :: ID ) ;
247+ msg. handle ( app, & mut req) . await
248+ }
232249}
You can’t perform that action at this time.
0 commit comments