0

I am trying to test my web application using JUnit. I saw that there is cdi-unit which seems pretty nice or Arquillian with JBoss (I am on Seam3, JBoss 7.1.3) but I can't make it work.

As soon as I try to inject a bean (and I need to inject multiple beans for my tests), it isn't working. I get "unsatisfied injection for type[...] with qualifiers [@default] at injection point".

Especially for the EntityManager which I need to inject. Is there some easy plugin I can add to my pom file in order to get this working ?

Thanks !

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
jojo____
  • 247
  • 3
  • 16

1 Answers1

2

You should have a look at the DeltaSpike Test Control module. This will start an embedded CDI container in your test. It is really simple to set up.

Have a look at the module documentation here:

http://deltaspike.apache.org/documentation/test-control.html

chkal
  • 5,598
  • 21
  • 26