我正在尝试测试编写为 Lagom 服务的 REST 端点。该文档仅指定如何测试快乐路径。从文档。
"The HelloService" should {
"say hello" in {
client.sayHello.invoke("Alice").map { response =>
response should ===("Hello Alice!")
}
}
}
您将如何测试 REST API 响应,例如BadRequest、InternalServerError等?我尝试assertThrows了interceptScalaTest 的 api,但它们不是这个用例的正确方法。