在测试期间将值添加到会话(FakeRequest,FakeApplication) [英] Add values to Session during testing (FakeRequest, FakeApplication)

查看:104
本文介绍了在测试期间将值添加到会话(FakeRequest,FakeApplication)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试围绕一种从会话中读取一些数据的方法来构建一些测试.

I'm trying to build some tests around a method that reads some data from the session.

我尝试扩展FakeRequest并覆盖session值,但是在编译时出现错误,提示session在覆盖时必须为val,这是行不通的.

I tried extending FakeRequest and overriding the session value, but I get an error on compilation saying that session has to be a val when overriden, which won't work.

如何修改FakeRequest()为会话添加值?

How can I modify a FakeRequest() to add values to the session?

推荐答案

有关此功能的请求请求

请参见 https://github.com/playframework/Play20/pull/103

这篇关于在测试期间将值添加到会话(FakeRequest,FakeApplication)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆