3 Replies Latest reply on Jun 2, 2017 7:57 AM by Meindert Hoving

    Setting up a Caller Principal in an Arquillian test

    Thomas Woelfle Newbie

      Hi,

       

      we are using Arquillian to test our business layer. It works pretty well. Thanks for that great framework

       

      Currently I am writing some permission tests where I want to ensure that certain business methods can be invoked only if the current user (derived form the caller principal of the SessionContext) has sufficient permissions. The SessionContext is injected into a StatelessSession Bean in the business layer via a @Resource annotation. When running the Arquillian Unit test the injected SessionContext property is null.

       

      How can I simulate a user login in an Arquillian unit test so that the SessionContext is created?

       

      Best regards,

      Thomas