![]() |
1
1
如图所示: https://github.com/jamesward/play2torial/blob/master/JAVA.md#create-a-model 您需要创建一个“fakeApplication”,如下所示:
如果这不起作用,或者如果这不是您想要的,那么另一种方法将更加复杂,与PlayJava文档不同: https://www.playframework.com/documentation/2.3.x/JavaTest#Unit-testing-models 基本上,您必须为模型创建包装器,并在单元测试中模拟包装器。 |