【发布时间】:2020-04-09 23:16:45
【问题描述】:
我正在从 Java 过渡到 Scala。我正在寻找一种方法来进行类似的测试:
//As a template is a just a method, you can execute it from a test and check the result:
@Test
public void renderTemplate() {
Content html = views.html.index.render("Welcome to Play!");
assertEquals("text/html", html.contentType());
assertTrue(contentAsString(html).contains("Welcome to Play!"));
}
我在这里找到它:https://www.playframework.com/documentation/2.8.x/JavaTest 任何试图在文档中找到这个以在 scala 中编写类似测试的尝试都失败了。有人可以帮忙吗?
【问题讨论】:
标签: scala playframework