The following test fails:
@RunWith(Arquillian.class)
|
public class WeldTest {
|
|
@Deployment
|
public static Archive deployment() {
|
return ShrinkWrap.create(JavaArchive.class)
|
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
|
}
|
|
@Produces
|
private Foo def = new Foo();
|
|
@Any
|
@Produces
|
private Foo any = new Foo();
|
|
@Test
|
public void name() {
|
|
}
|
|
private static class Bar {
|
|
@Inject
|
Foo foo;
|
}
|
}
|
|
class Foo {
|
|
}
|
With the following message:
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type Foo with qualifiers @Default
|
at injection point [BackedAnnotatedField] @Inject WeldTest$Bar.foo
|
at WeldTest$Bar.foo(Bar.java:0)
|
Possible dependencies:
|
- Producer Field [Foo] with qualifiers [@Any @Default] declared as [[BackedAnnotatedField] @Produces private WeldTest.def],
|
- Producer Field [Foo] with qualifiers [@Default @Any] declared as [[BackedAnnotatedField] @Any @Produces private WeldTest.any]
|
|