【发布时间】:2016-06-29 07:52:58
【问题描述】:
我有一个使用 Spring Boot 运行的 Web 应用程序。现在我必须用 Rest Assured 编写测试。 但是,为了运行其中一些,我必须在服务器上进行身份验证。服务器使用 google oauth 身份验证。有什么办法可以放心地模拟会话吗? 文档并没有对此进行太多说明,并且其中涵盖的方法也无济于事。
when()
.sessionId("id here")
在服务器端,我使用的是带有 userId 参数的 HttpSession。
【问题讨论】:
-
你可以使用restito来模拟认证服务器。
标签: spring authentication testing mocking rest-assured