I'm using JBosss EAP 7. To avoid long turnaround cycles it would be nice to test WebService consumer directly without starting the Appserver. For this purpose we are working with DeltaSpike and Mockito. Besides this our application is based on an internal Framework, which generates Consumer classes like XyConsumer.
I'm wondering if there is a way to inject resources with @Resource into a class, which is instantiated by DeltaSpike? As far as I understand DeltaSpike is a CDI container, but @Resource injects resources from underlying Web- or EJB-container. In my case I have following scenario:
class TestDAO {
@Inject
XyConsumer consumer;
assertNotNull(consumer.getEntity());
}
class XyConsumer {
@Resource(name="jndipath")
resource;
public Object getEntity(){
String wsEndpoint = resource.get("endpoint");
this.callWebService(..., wsEndpoint);
}
}
Thanks in advance!