• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate Integration Unit Testing Issues

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am attempting to use Spring's AbstractTransactionalDataSourceSpringContextTests to Unit Test my Spring/Hibernate DAO layer. Unfortunately, the DAO methods use the load() method of the HibernateTemplate class, which does not return the actual object, but a Proxy to the object.

My "loadById()" methods work correctly, but when I use them to get data which I then pass to the actual method under test, the test terminates at the assertXXX() statement (i.e. assertEquals("Bad User, no cookie", report1, report2)).

Here is some actual code to show what I am talking about (edited to remove identifying information):

ReportDao:


And here is the relevant unit test code:



Any help would be appreciated.
 
Well THAT's new! Comfort me, reliable tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic