开发者

TestNG and JPA not sure what's going on... but my test fails

开发者 https://www.devze.com 2023-03-02 11:43 出处:网络
I am running some persistence tests and when I use the method create or create-drop... my test fails when I use update it succeed.

I am running some persistence tests and when I use the method create or create-drop... my test fails when I use update it succeed.

My test is composed of 2 methods, one creates an user in the BD the other method searches for this user.

Both are @Test and I an using Groups and DependsOnGroups to make then execute in the order I need.(insert before search)

What I hav开发者_StackOverflow社区e noticed is that when the second test runs the table is empty... does Hibernate cleans the tables after every test ? why does it work with update in Hibernate settings ?


My guess is that your first test isn't flushing to the db. Try explicitly flushing.

session.flush();

0

精彩评论

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