Hi all,
I am trying to use deltaspike for testing business logic. The idea is run
CDI container inside the junit test replacing some beans with alternatives.
Before I tried cdi-unit but stack with bean-validation (I was not able to
enforce method parameter validation to work as it is expected by JEE
container). So I decided to use deltaspike for that. I succesfully
connected hivernate-bean-validator-cdi for bean-validation, created entity
manager that uses embedded in-memory database which is recreated on each
test, but ran into the problem with transations. The problem is that I am
testing code which have no idea about deltaspike and I want to keep it this
way. I am testing class which is annotated as 'javax.ejb.Stateless' and I
expect it to be transactional. But in my tests it not. Annotating such
class as 'org.apache.deltaspike.jpa.api.transaction.Transactional' solves
the problem but I can't use it becase as I said before, code under test
should not know about deltaspike. Is there a way to force it somehow? Or
maybe someone else uses deltaspike for testing JEE EJBs and they know some
better strategy? Or I am overoptimistic in my expectations from deltaspike
and I ask too much of it?

Reply via email to