0 Replies Latest reply on Jun 25, 2013 8:56 AM by Felipe Reis

    Is there a way to use @EJB in my test classes

    Felipe Reis Newbie



      I'm trying to use @EJB to inject Stateless Beans into my test classes, but it is not working, the objects are always null.



      public class MyTestClass extends TestJSFUnitBase {



                protected MyStateless myStateless;



                public static WebArchive criaDeployment() {

           // create war

           return war;



      @Test @InitialPage("/faces/paginas/publicas/login.xhtml")

                 public void redirecionaParaPaginaDeLoginSeNaoEstiverLogado() throws IOException {

            // myStateless is always null at this point