Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 如何测试游戏';用@with annotation注释的控制器?_Unit Testing_Controller_Playframework - Fatal编程技术网

Unit testing 如何测试游戏';用@with annotation注释的控制器?

Unit testing 如何测试游戏';用@with annotation注释的控制器?,unit-testing,controller,playframework,Unit Testing,Controller,Playframework,我使用带注释@With(Secure.class)的拦截器来检查对控制器的访问。 我想测试控制器中执行的一些常规逻辑 但是,当我运行我的测试(startTest)时,它被Secure截获,导致测试失败 startTest A play.mvc.results.Redirect has been caught, null Hide trace play.mvc.results.Redirect 有没有办法避免重定向?添加类和测试,我有那个模块,没有那个问题

我使用带注释@With(Secure.class)的拦截器来检查对控制器的访问。 我想测试控制器中执行的一些常规逻辑

但是,当我运行我的测试(startTest)时,它被Secure截获,导致测试失败

 startTest  A play.mvc.results.Redirect has been caught, null Hide trace 
 play.mvc.results.Redirect

有没有办法避免重定向?

添加类和测试,我有那个模块,没有那个问题