I am trying to write a unit test class which will have to use same query to fetch the results from database two times in same test method. But as Hibernate cache is enabled
If you create a new (different) session within your unit test, it will "not" use the old one's cache. Or if you call clear() on it first (another option), etc.