Results 1 to 1 of 1
- 09-30-2011, 06:08 PM #1
Member
- Join Date
- Sep 2011
- Posts
- 1
- Rep Power
- 0
Mocking of the Hibernate getSession() object
I am using PowerMock to mock a class having a method
it fails at the following line of code
getSession().createSQLQuery(sqlquerystr);
since i am unable to mock create the getSession() object
the getSession object is returning a session object from org.hibernate.Session.class
is there any manner in which one can directly mock the object returned by the getSession() method
for example using the Whitebox approach.
Thanks in advance.
Similar Threads
-
Mocking a hospital database - OOP.
By Nanomech in forum New To JavaReplies: 15Last Post: 09-07-2011, 05:18 PM -
Problem in mocking a class
By nonhocapito in forum New To JavaReplies: 0Last Post: 10-05-2010, 08:01 AM -
getSession() Function Return Null value
By dalchndr@gmail.com in forum Advanced JavaReplies: 0Last Post: 11-04-2009, 07:24 AM -
Mocking a class for Testing
By hotinlavacoolinjava in forum New To JavaReplies: 4Last Post: 09-22-2009, 10:23 AM -
How to get object from composite-id in Hibernate?
By ibjava in forum JDBCReplies: 1Last Post: 05-07-2008, 04:05 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks