I have application with PicketLink included as maven dependency. I have written arquillian test case that does not involve PicketLink in any way, but test is failing because of CDI in picketlink.
@RunWith(Arquillian.class)
public class WebServiceTest {
@Deployment
public static WebArchive deployment() {
return ShrinkWrap.create(WebArchive.class, "test.war")
.addAsManifestResource(new File("test/beans.xml"));
}
@Test
public void testMath() {
Assert.assertEquals(2, 1+1);
}
}
When I run JUnit test, i get this error:
Unsatisfied dependencies for type [DefaultLoginCredentials] with qualifiers [@Default]
at injection point [[field] @Inject private org.picketlink.internal.AbstractIdentity.loginCredential]
Which is wierd, considering I'm not including picketlink into WebArchive at all. I tought arquillian should isolate test case from the rest of my application. Moreover, I'm excluding picketlink in beans.xml that I'm including into WebArchive:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">
<scan>
<exclude name="org.picketlink.**" />
</scan>
</beans>
Similar problem was also reported on developer.jboss, but without any resolution. Any help would be appreciated.