I use spring and hibernate with a ria technology called ZKOSS and use the OpenSessionInViewFilter paradigm,
I have integration tests to test features like
1) Entity is loaded into the UI (has lazily loaded entities)
2) Updates are made to it on the UI -- (In the tests UI is replicated through a series of setter method calls)
3) Update button pressed and entity is updated
and more often than not my tests pass.
However when i really start using the application, I end up getting lazy loading exception, because
1) Entity is loaded into the UI -- Loaded in session1 (proxy points to session1)
2) Updates are made to it on the UI -- (In the tests UI is replicated through a series of setter method calls)
3) Update button pressed and entity is updated -- (try to access a lazily loaded entity) and get an lazy loading exception
I want to catch such exceptions in my integration tests, any ideas ? ... is my approach correct here ?
Thanks