package com.acme.cdi.failure; import javax.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.ShouldThrowException; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class AmbiguousDependencyTestCase { @Deployment @ShouldThrowException(Exception.class) public static JavaArchive createDeployment() { return ShrinkWrap.create(JavaArchive.class) .addPackage(Service.class.getPackage()) .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } // the presense of this injection triggers the cdi validation on weblogic @Inject ServiceClient client; @Test public void shouldFailDeployment() { // this method forces the deployment to be attempted } }