Wiki

Clone wiki

MagDownloads / Arquillian - Listing 8

@RunWith(Arquillian.class)
public class CustomerControllerTest {

    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class, "CustomerControllerTest.war")
           .addClass(org.javamagazine.arquillianexample.cdi.CustomerController.class)
           .addClass(org.javamagazine.arquillianexample.session.CustomerFacade.class)
           .addClass(org.javamagazine.arquillianexample.entity.Customer.class)
           .addAsResource("test-persistence.xml", "META-INF/persistence.xml")
           .addAsManifestResource(EmptyAsset.INSTANCE,"beans.xml");
    }

    @Inject
    CustomerController customerController;

    @Test
    public void test_customer_list() {
        Assert.assertTrue(customerController.getCustomerList() != null);
    }
}

Updated