我正在尝试测试这样的功能:
@Test
public void testAddTask() {
FakeApplication fakeApplication = fakeApplication(inMemoryDatabase());
start(fakeApplication);
Task task=new Task();
task.title="test Task";
task.save();
assertThat(Task.find.where().ilike("title", "task")).isNull();
stop(fakeApplication);
}
哪个成功哪个是错误的
@Test
public void testAddTask(){
running(fakeApplication(inMemoryDatabase()), new Runnable() {
public void run() {
Task task=new Task();
task.title="test Task";
task.save();
assertThat(Task.find.where().ilike("title", "task")).isNull();
}
});
}
失败了,这就是我所期望的。
不应该startfakeapplication
与`running(fakeApplication()?