title: mocking and integration testing for managed and sessions beans
body: <p>I don't know what am I doing wrong but I'm really frustrated and in a race with time. I have EJB entities that are derived from database,stateless local session beans (most of them facades) that persists these entities into db and managed beans that use session beans.</p>
  
  <p>So my managed beans look like these:</p>
  
  <pre><code>@ManagedBean
  public class SomeBean {
  
     //attributes
  
      @EJB
      private SomeSessionBean sb;
  
      // getters and setters and other methods
  
      public void createObject(){
         // some logic
            sh.method(arguments);
      }
  }
  </code></pre>
  
  <p>I need to do some JUnit mock (preferably using Mockito) testing in my managed beans.
  I also need to do mock and integration with db testing in my session beans.Also few testings using Arquillian (from what I understood Arquillian integrates tests with the Jboss server)    </p>
  
  <p>Can anyone explain or write some sample code, or point to some sites but please let them be relevant to my case?</p>
  
  <p>I'm working in a web application in NetBeans.</p>