Wiki

Clone wiki

MagDownloads / Arquillian - Listing 4

import javax.inject.Inject;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;

@RunWith(Arquillian.class)
public class PoolControllerTest {
    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class, "PoolControllerTest.war")
            .addClass(org.javamagazine.arquillianexample.cdi.PoolController.class)
            .addClass(org.javamagazine.arquillianexample.entity.Pool.class)
            .addAsManifestResource(EmptyAsset.INSTANCE,"beans.xml");
    }

    @Inject
    PoolController poolController;

    @Test
    public void pool_list_populated() {
        Assert.assertEquals(2, poolController.getPoolList().size());
    }
}

Updated