How does a very intricate Criteria API logic gets tested?

36 Views Asked by At

I have built a very intricate 100+ lines of code of queries and joins and predicates that are added if some conditions are met and so on.

In short, I have to test all of this now and I have created mocks upon mocks upon mocks hoping Mockito is the way but this doesn't seem to be right.

I just wanted to know if there is other way to unit test the method in which I am creating this very elaborate logic?

1

There are 1 best solutions below

0
maria_so On

I ended up mocking everything for this type of testing but also added some integration tests in order to properly check the functionality.