title: JUnit Test for Dao and Service with Arquillian
body: <p>Hi I'm trying to test my Service and Dao layers for a Java EE 7 application.</p>
  
  <p>So I looking for testing solutions follow tutorials using Arquillian with junit test and wildfly remote dependence.</p>
  
  <p>Dao and Service interfaces with relative implementations have been created, following my junit test with Arquillian:</p>
  
  <pre><code>@RunWith(Arquillian.class)
  public class GenericServiceTest {
  
      @Inject
      private EmployeeService employeeService;
  
      @Deployment
      public static JavaArchive createDeployment() {
          return ShrinkWrap
                  .create(JavaArchive.class)
                  .addAsManifestResource("META-INF/persistence.xml",
                          "persistence.xml")
                  .addClasses(EmployeeDao.class, EmployeeDaoImpl.class,
                          EmployeeService.class, EmployeeServiceImpl.class,
                          Employee.class)
                  .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
  
      }
  
      @Test
      @Transactional
      public void should_crud() {
          // Gets all the objects
          assertNotNull(employeeService);
          Employee employee = employeeService.get(new Integer(1));
          assertNotNull(employee);
      }
  }
  </code></pre>
  
  <p>Running class as JUnit Test it doesn't work with this error:</p>
  
  <p>Caused by: java.lang.Exception: "WFLYCTL0216: Management resource '[(\"deployment\" => \"test.war\")]' not found"</p>
  
  <p>Test pass if any classes has been added to ShrinkWrap as following:</p>
  
  <pre><code>@RunWith(Arquillian.class)
  public class GenericDaoTest {
  @Inject
  private EmployeeService employeeService;
  
      @Deployment
      public static JavaArchive createTestableDeployment() {
          final JavaArchive jar = ShrinkWrap.create(JavaArchive.class)
              .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
      return jar;
      }
  
      @Test
      public void should_crud() {
      }
  
  }
  </code></pre>
  
  <p>How can I create a working test using arquillian for Java EE 7 adding service class implementations?</p>
  
  <p>And I have To add every Class and Intefaces that have to be called (for example all entities,dao etc classes) or only Service Interface and implementation Class? </p>
  
  <p>Thanks a lot</p>