@RunWith(Arquillian.class)
@MyInterceptor
public class ItTest {
@Deployment
public static Archive<?> createDeployment() {
WebArchive war = Deployments.getBaseDeployment();
//war.addAsWebInfResource(new File(WEB_INF, "beans.xml"), "beans.xml");
war.addAsResource(new File(WEB_INF, "beans.xml"), "META-INF/beans.xml");//beans.xml enables the interceptor
war.addClass(ItTest.class);
return war;
}
@Test
public void test(){
// interceptor should be called...or not
}
}|
Note
|
interceptor is inside a jar(which has beans.xml) which is added into test deployment. |
beans.xml:
<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"
bean-discovery-mode="all">
<interceptors>
//
</interceptors>
</beans>
Rafael, você conseguiu uma resposta para esse questionamento?