开发者

Fixtures.loadYaml in FunctionalTest didn't really load the data

开发者 https://www.devze.com 2023-03-31 00:27 出处:网络
I have the following functional test that setup the initial data via fixtures.loadYaml, but when I开发者_运维问答 query the records in testcase, I don\'t see them. Any reasons?

I have the following functional test that setup the initial data via fixtures.loadYaml, but when I开发者_运维问答 query the records in testcase, I don't see them. Any reasons?

public class UsersTest extends FunctionalTest {
    @Before
    public void setup() {
        Fixtures.loadYaml("data.yml");
    }

    @Test
    public void testIndex() {
        ....
    }


Based on the documentation on latest release http://www.playframework.org/documentation/1.2.3/test, I instead called loadModels, and it worked.

@Before
public void setup() {
    Fixtures.deleteAllModels();
    Fixtures.loadModels("data.yml");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消