Can SwitchYardTestKit be used to test EJBs, or can Arquillian test SwitchYard Services?

Solution Verified - Updated -

Issue

  • Beans are annotated to be both SwitchYard Services and EJBs. Can SwitchYardTestKit be used to test both aspects? Can Arquillian?
  • We wrote unit tests for a SwitchYard project using SwithYardRunner, but a remote EJB reference does not get initialised by the framework (we are using an @EJB annotation) and we cannot get hold of the SwitchYard bean instance to manually set a mock.
@Service(SampleService.class)
public class SampleServiceImpl implements SampleService {
    @EJB(lookup = "...")
    private AnotherRemoteService reemoteService;
  • How are unit tests written in this situation?

Environment

  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content