玩框架功能测试
public class MyFunctionalTest extends FunctionalTest {
Http.Response response = GET( "/page1");
assertStatus(302/*REDIRECT*/, response);
///TODO: check where it redirects to
...
如何检查重定向到哪里?哪个网址?
答案 0 :(得分:4)
您可以检查位置标题:
assertEquals("/yourExpectedTarget", response.getHeader("Location"));