【发布时间】:2012-10-22 07:03:43
【问题描述】:
我有一个带有 play-authenticate 的新 Play 2 项目。我为 REST API 编写了一些简单的测试用例。测试在控制台上顺利通过,但我无法让其中一些在 Eclipse 中通过。
@Test
public void testWithoutAuth() {
running(testServer(3333), new Runnable() {
@Override
public void run() {
Response response = WS.url("http://localhost:3333/secretarea").get().get();
assertThat(response.getStatus()).isEqualTo(FORBIDDEN);
}
});
}
此示例在控制台上正常通过,但在 Eclipse 中失败,响应错误代码为 500。看起来应用程序设置不正确(例如,我自己的 AuthProvider 未找到)。有没有人设法让这样的测试在 Eclipse 中工作?
【问题讨论】:
标签: eclipse junit playframework-2.0 play-authenticate