How to test DAO methods using Mockito?

后端 未结 4 696
抹茶落季
抹茶落季 2021-01-31 09:24

I\'ve started to discovered Mockito library and there is a question for which I didn\'t find the proper answer.

If I have for example such method in my UserDAO class tha

4条回答
  •  误落风尘
    2021-01-31 09:28

    A tool like DBUnit combined with JUnit could help you testing your DAOs with the database. DBUnit helps you inserting test data to the database before your UnitTest and compare the data in the database with your expectation after the test.

提交回复
热议问题