Le vendredi 29 mars 2013 21:02:28 UTC+1, Jeffrey Cameron a écrit :
I guess no one else has run into this issue ...
Hi,
I have exactly the same problem!
It uses the @txn tag to use transactions to allow entities to be lazy loaded in step definitions.
Thanks
Thanks, but in my case, it doesn't work.
In fact, the Lazy Loading is working.
But I don't know why, I have a strange behavior with JPA.
I have several mapping for the same table, when I save the object A, I can query A and retrieve A.myCollection.
But then, when I query B, I can retrieve it but B.myCollection is empty.
Anyway, I prefer to commit on each steps, so I can verify the temporary Database in case of test failure.
(And I purge it before each scenarios).
But I didn't find any way to repeat an action before/after any steps.
Am I missing something?
The @Transactional on steps is not working, because cucumber-spring is creating the Test class with a constructor, so Spring is not responsible of creating the Test class and can't do AOP.
Is it a feature request that I can create in Github ?